Skip to content

Commit

Permalink
feat: use react-router-dom
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Apr 10, 2024
1 parent 84a56b0 commit 33bf4f4
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 308 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@electron-toolkit/preload": "^3.0.0",
"@electron-toolkit/utils": "^3.0.0",
"electron-updater": "^6.1.7",
"react-router-dom": "6.22.3",
"tailwind-merge": "2.2.2"
},
"devDependencies": {
Expand Down
36 changes: 31 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 1 addition & 28 deletions src/renderer/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,7 @@
import Versions from './components/Versions'
import electronLogo from './assets/electron.svg'

function App(): JSX.Element {
const ipcHandle = (): void => window.electron.ipcRenderer.send('ping')

return (
<>
<img alt="logo" className="logo" src={electronLogo} />
<div className="creator">Powered by electron-vite</div>
<div className="text">
<span className="i-mingcute-rss-fill"></span>
Build an Electron app with <span className="react">React</span>
&nbsp;and <span className="ts">TypeScript</span>
</div>
<p className="tip">
Please try pressing <code>F12</code> to open the devTool
</p>
<div className="actions">
<div className="action">
<a href="https://electron-vite.org/" target="_blank" rel="noreferrer">
Documentation
</a>
</div>
<div className="action">
<a target="_blank" rel="noreferrer" onClick={ipcHandle}>
Send IPC
</a>
</div>
</div>
<Versions></Versions>
Home
</>
)
}
Expand Down
68 changes: 0 additions & 68 deletions src/renderer/src/assets/base.css

This file was deleted.

10 changes: 0 additions & 10 deletions src/renderer/src/assets/electron.svg

This file was deleted.

171 changes: 0 additions & 171 deletions src/renderer/src/assets/main.css
Original file line number Diff line number Diff line change
@@ -1,173 +1,2 @@
@import './tailwind.css';
@import './base.css';
@import './font.css';

body {
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
background-image: url('./wavy-lines.svg');
background-size: cover;
user-select: none;
}

code {
font-weight: 600;
padding: 3px 5px;
border-radius: 2px;
background-color: var(--color-background-mute);
font-family:
ui-monospace,
SFMono-Regular,
SF Mono,
Menlo,
Consolas,
Liberation Mono,
monospace;
font-size: 85%;
}

#root {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-bottom: 80px;
}

.logo {
margin-bottom: 20px;
-webkit-user-drag: none;
height: 128px;
width: 128px;
will-change: filter;
transition: filter 300ms;
}

.logo:hover {
filter: drop-shadow(0 0 1.2em #6988e6aa);
}

.creator {
font-size: 14px;
line-height: 16px;
color: var(--ev-c-text-2);
font-weight: 600;
margin-bottom: 10px;
}

.text {
font-size: 28px;
color: var(--ev-c-text-1);
font-weight: 700;
line-height: 32px;
text-align: center;
margin: 0 10px;
padding: 16px 0;
}

.tip {
font-size: 16px;
line-height: 24px;
color: var(--ev-c-text-2);
font-weight: 600;
}

.react {
background: -webkit-linear-gradient(315deg, #087ea4 55%, #7c93ee);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: 700;
}

.ts {
background: -webkit-linear-gradient(315deg, #3178c6 45%, #f0dc4e);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: 700;
}

.actions {
display: flex;
padding-top: 32px;
margin: -6px;
flex-wrap: wrap;
justify-content: flex-start;
}

.action {
flex-shrink: 0;
padding: 6px;
}

.action a {
cursor: pointer;
text-decoration: none;
display: inline-block;
border: 1px solid transparent;
text-align: center;
font-weight: 600;
white-space: nowrap;
border-radius: 20px;
padding: 0 20px;
line-height: 38px;
font-size: 14px;
border-color: var(--ev-button-alt-border);
color: var(--ev-button-alt-text);
background-color: var(--ev-button-alt-bg);
}

.action a:hover {
border-color: var(--ev-button-alt-hover-border);
color: var(--ev-button-alt-hover-text);
background-color: var(--ev-button-alt-hover-bg);
}

.versions {
position: absolute;
bottom: 30px;
margin: 0 auto;
padding: 15px 0;
font-family: 'Menlo', 'Lucida Console', monospace;
display: inline-flex;
overflow: hidden;
align-items: center;
border-radius: 22px;
background-color: #202127;
backdrop-filter: blur(24px);
}

.versions li {
display: block;
float: left;
border-right: 1px solid var(--ev-c-gray-1);
padding: 0 20px;
font-size: 14px;
line-height: 14px;
opacity: 0.8;
&:last-child {
border: none;
}
}

@media (max-width: 720px) {
.text {
font-size: 20px;
}
}

@media (max-width: 620px) {
.versions {
display: none;
}
}

@media (max-width: 350px) {
.tip,
.actions {
display: none;
}
}
Loading

0 comments on commit 33bf4f4

Please sign in to comment.