Skip to content

Commit 024114a

Browse files
authored
Merge pull request #6 from kusitms-com/feat/admin-common-components-5
[Feat] 어드민 공통 컴포넌트 제작
2 parents bd38347 + 3c0d298 commit 024114a

52 files changed

Lines changed: 832 additions & 418 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.husky/pre-commit

100644100755
File mode changed.

public/icons.svg

Lines changed: 0 additions & 24 deletions
This file was deleted.

scripts/build-icons.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { basename, extname, join } from 'node:path'
33
import { transform } from '@svgr/core'
44
import jsxPlugin from '@svgr/plugin-jsx'
55
import svgoPlugin from '@svgr/plugin-svgo'
6-
import { format } from 'prettier'
6+
import { format, resolveConfig } from 'prettier'
77

88
const GENERATED_TAG = '// @generated'
99
const ICON_ROOT = join(process.cwd(), 'src/assets/icons')
@@ -84,6 +84,7 @@ const renderComponent = async (source: IconSource) => {
8484
{
8585
expandProps: 'end',
8686
icon: false,
87+
jsxRuntime: 'automatic',
8788
plugins: svgrPlugins,
8889
prettier: false,
8990
svgo: true,
@@ -105,11 +106,12 @@ const renderComponent = async (source: IconSource) => {
105106
{ componentName: source.componentName },
106107
)
107108

109+
const prettierConfig =
110+
(await resolveConfig(join(OUTPUT_DIR, `${source.componentName}.tsx`))) ?? {}
111+
108112
return format(`${GENERATED_TAG}\n${componentCode}`, {
113+
...prettierConfig,
109114
parser: 'typescript',
110-
semi: false,
111-
singleQuote: true,
112-
trailingComma: 'all',
113115
})
114116
}
115117

@@ -120,13 +122,13 @@ const renderIndex = async (sources: IconSource[]) => {
120122
)
121123
.join('\n')
122124

125+
const prettierConfig = (await resolveConfig(join(OUTPUT_DIR, 'index.ts'))) ?? {}
126+
123127
return format(
124128
`${GENERATED_TAG}\n\nexport type { SVGProps as IconProps } from 'react'\n\n${exports}\n`,
125129
{
130+
...prettierConfig,
126131
parser: 'typescript',
127-
semi: false,
128-
singleQuote: true,
129-
trailingComma: 'all',
130132
},
131133
)
132134
}

src/App.css

Lines changed: 0 additions & 182 deletions
This file was deleted.

src/App.tsx

Lines changed: 1 addition & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,5 @@
1-
import { useState } from 'react'
2-
import reactLogo from './assets/react.svg'
3-
import viteLogo from './assets/vite.svg'
4-
import heroImg from './assets/hero.png'
5-
import './App.css'
6-
71
function App() {
8-
const [count, setCount] = useState(0)
9-
10-
return (
11-
<>
12-
<section id="center">
13-
<div className="hero">
14-
<img src={heroImg} className="base" width="170" height="179" alt="" />
15-
<img src={reactLogo} className="framework" alt="React logo" />
16-
<img src={viteLogo} className="vite" alt="Vite logo" />
17-
</div>
18-
<div>
19-
<h1>Get started</h1>
20-
<p>
21-
Edit <code>src/App.tsx</code> and save to test <code>HMR</code>
22-
</p>
23-
</div>
24-
<button
25-
type="button"
26-
className="counter"
27-
onClick={() => {
28-
setCount((count) => count + 1)
29-
}}
30-
>
31-
Count is {count}
32-
</button>
33-
</section>
34-
35-
<div className="ticks"></div>
36-
37-
<section id="next-steps">
38-
<div id="docs">
39-
<svg className="icon" role="presentation" aria-hidden="true">
40-
<use href="/icons.svg#documentation-icon"></use>
41-
</svg>
42-
<h2>Documentation</h2>
43-
<p>Your questions, answered</p>
44-
<ul>
45-
<li>
46-
<a href="https://vite.dev/" target="_blank">
47-
<img className="logo" src={viteLogo} alt="" />
48-
Explore Vite
49-
</a>
50-
</li>
51-
<li>
52-
<a href="https://react.dev/" target="_blank">
53-
<img className="button-icon" src={reactLogo} alt="" />
54-
Learn more
55-
</a>
56-
</li>
57-
</ul>
58-
</div>
59-
<div id="social">
60-
<svg className="icon" role="presentation" aria-hidden="true">
61-
<use href="/icons.svg#social-icon"></use>
62-
</svg>
63-
<h2>Connect with us</h2>
64-
<p>Join the Vite community</p>
65-
<ul>
66-
<li>
67-
<a href="https://github.com/vitejs/vite" target="_blank">
68-
<svg className="button-icon" role="presentation" aria-hidden="true">
69-
<use href="/icons.svg#github-icon"></use>
70-
</svg>
71-
GitHub
72-
</a>
73-
</li>
74-
<li>
75-
<a href="https://chat.vite.dev/" target="_blank">
76-
<svg className="button-icon" role="presentation" aria-hidden="true">
77-
<use href="/icons.svg#discord-icon"></use>
78-
</svg>
79-
Discord
80-
</a>
81-
</li>
82-
<li>
83-
<a href="https://x.com/vite_js" target="_blank">
84-
<svg className="button-icon" role="presentation" aria-hidden="true">
85-
<use href="/icons.svg#x-icon"></use>
86-
</svg>
87-
X.com
88-
</a>
89-
</li>
90-
<li>
91-
<a href="https://bsky.app/profile/vite.dev" target="_blank">
92-
<svg className="button-icon" role="presentation" aria-hidden="true">
93-
<use href="/icons.svg#bluesky-icon"></use>
94-
</svg>
95-
Bluesky
96-
</a>
97-
</li>
98-
</ul>
99-
</div>
100-
</section>
101-
102-
<div className="ticks"></div>
103-
<section id="spacer"></section>
104-
</>
105-
)
2+
return null
1063
}
1074

1085
export default App

src/assets/hero.png

-12.8 KB
Binary file not shown.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// @generated
2+
import type { SVGProps } from 'react'
3+
const AddIcon = (props: SVGProps<SVGSVGElement>) => (
4+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" {...props}>
5+
<g clipPath="url(#a)">
6+
<path fill="currentColor" d="M8 2.429v11.143zM2.429 8H13.57z" />
7+
<path
8+
stroke="currentColor"
9+
strokeLinecap="round"
10+
strokeWidth={1.857}
11+
d="M8 2.429v11.143M2.429 8H13.57"
12+
/>
13+
</g>
14+
<defs>
15+
<clipPath id="a">
16+
<path fill="currentColor" d="M1.5 1.5h13v13h-13z" />
17+
</clipPath>
18+
</defs>
19+
</svg>
20+
)
21+
export default AddIcon

0 commit comments

Comments
 (0)