Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor]: icon generator logic #50

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/node_modules
node_modules/
/dist
.DS_Store
.idea
63 changes: 11 additions & 52 deletions .source

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions examples/vite/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="./src/index.jsx"></script>
</body>
</html>
25 changes: 25 additions & 0 deletions examples/vite/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "geist-icons-example",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"dev":"vite",
"build":"vite build"
},
"dependencies": {
"@geist-ui/icons": "file:../../dist",
"@geist-ui/react": "latest",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"devDependencies": {
"@types/react": "^16.9.32",
"@types/react-dom": "^16.9.6",
"vite":"^2.9.13",
"@vitejs/plugin-react":"1.3.2"
},
"resolutions": {
"esbuild": "0.14.3"
}
}
34 changes: 34 additions & 0 deletions examples/vite/src/home.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react'
import { Card, Spacer, Button, useTheme } from '@geist-ui/react'
import { Activity, Github, Twitch, Headphones } from '@geist-ui/icons'

const Home = ({ onThemeChange }) => {
const theme = useTheme()

return (
<div style={{ width: '500px', margin: '100px auto' }}>
<Button auto scale={0.3} onClick={onThemeChange}>
Switch Theme
</Button>
<Spacer />
<Card shadow>
<Activity /> <Spacer inline x={0.5} />
<Github color={theme.palette.success} /> <Spacer inline x={0.5} />
<Twitch color={theme.palette.warningLight} /> <Spacer inline x={0.5} />
<Headphones color={theme.palette.purple} />
<Spacer />
<Activity size={30} /> <Spacer inline x={0.5} />
<Github size={30} color={theme.palette.success} /> <Spacer inline x={0.5} />
<Twitch size={30} color={theme.palette.warningLight} /> <Spacer inline x={0.5} />
<Headphones size={30} color={theme.palette.purple} />
<Spacer />
<Activity size={36} /> <Spacer inline x={0.5} />
<Github size={36} color={theme.palette.success} /> <Spacer inline x={0.5} />
<Twitch size={36} color={theme.palette.warningLight} /> <Spacer inline x={0.5} />
<Headphones size={36} color={theme.palette.purple} />
</Card>
</div>
)
}

export default Home
24 changes: 24 additions & 0 deletions examples/vite/src/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React, { useState } from 'react'
import ReactDom from 'react-dom'
import { GeistProvider, CssBaseline, Themes } from '@geist-ui/react'
import Home from './home'

const App = () => {
const [dark, setDark] = useState(false)

return (
<GeistProvider themes={Themes.getPresets()} themeType={dark ? 'dark' : 'light'}>
<CssBaseline />
<Home onThemeChange={() => setDark(last => !last)} />
</GeistProvider>
)
}

ReactDom.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('app'),
)

export default App
8 changes: 8 additions & 0 deletions examples/vite/vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// refer https://github.com/vitejs/vite/issues/7112

import { defineConfig } from 'vite'
import React from '@vitejs/plugin-react'

export default defineConfig({
plugins: [React()],
})
Loading