move to app directory
This commit is contained in:
parent
390ad99d67
commit
97835843e9
|
|
@ -1,5 +0,0 @@
|
|||
import '../style.scss'
|
||||
|
||||
export default function MyApp({ Component, pageProps }) {
|
||||
return <Component {...pageProps} />
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import icons from '../data/icons.json'
|
||||
import { Icon } from '../components/Icon.js'
|
||||
import { Sprite } from '../components/Sprite.js'
|
||||
|
||||
export default function Tags () {
|
||||
return <>
|
||||
<div class="container">
|
||||
<Sprite />
|
||||
|
||||
<div class="box">
|
||||
<table class="table mb">
|
||||
{icons.map(icon => (
|
||||
<tr key={icon.name}>
|
||||
<td class="td-1">
|
||||
<Icon name={icon.name} />
|
||||
</td>
|
||||
<th>{ icon.name }</th>
|
||||
<td>{ (icon.tags || []).join(', ') }</td>
|
||||
<td>{ icon.category }</td>
|
||||
<td>{ icon.version }</td>
|
||||
<td>{ icon.unicode }</td>
|
||||
</tr>
|
||||
))}
|
||||
</table>
|
||||
|
||||
{/*<p>Untagged: {{ i }}</p>*/}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
export default function Head() {
|
||||
return (
|
||||
<>
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
// import icons from '../data/icons.json'
|
||||
// import { Icon } from '../components/Icon.js'
|
||||
// import { Sprite } from '../components/Sprite.js'
|
||||
|
||||
export default function Icons() {
|
||||
return <>
|
||||
<div className="container">
|
||||
icons
|
||||
{/*<Sprite />*/}
|
||||
{/*<div className="box">*/}
|
||||
{/* <div className="mb">*/}
|
||||
{/* <div className="icons-list">*/}
|
||||
{/* {icons.map(icon => (*/}
|
||||
{/* <div className="icons-list-icon js-icon" title={icon.name}>*/}
|
||||
{/* <Icon name={icon.name}/>*/}
|
||||
{/* </div>*/}
|
||||
{/* ))}*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/*</div>*/}
|
||||
{/* {% if jekyll.environment != "development" %}*/}
|
||||
{/* <div class="box">*/}
|
||||
{/* <div class="mb">*/}
|
||||
{/* <div class="icons-list">*/}
|
||||
{/* {% for icon in site.icons %}*/}
|
||||
{/* {% assign name = icon.slug %}*/}
|
||||
{/* <div class="icons-list-icon js-icon" title="{{ icon.slug }}" data-icon="{{ name }}">*/}
|
||||
{/* {% include_cached icon.html name=name stroke=1.5 %}*/}
|
||||
{/* </div>*/}
|
||||
{/* {% endfor %}*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/* <div class="box">*/}
|
||||
{/* <div class="mb">*/}
|
||||
{/* <div class="icons-list">*/}
|
||||
{/* {% for icon in site.icons %}*/}
|
||||
{/* {% assign name = icon.slug %}*/}
|
||||
{/* <div class="icons-list-icon js-icon" title="{{ icon.slug }}" data-icon="{{ name }}">*/}
|
||||
{/* {% include_cached icon.html name=name stroke=1 %}*/}
|
||||
{/* </div>*/}
|
||||
{/* {% endfor %}*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/* {% endif %}*/}
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import '../style.scss'
|
||||
|
||||
export default function Layout({
|
||||
children,
|
||||
}) {
|
||||
return <html lang="en">
|
||||
<head />
|
||||
<body>{children}</body>
|
||||
</html>
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
// "use client"
|
||||
|
||||
// import { useState } from 'react'
|
||||
import { groupByCategory } from '../../svg.mjs'
|
||||
// import clsx from 'clsx'
|
||||
// import { Icon } from '../components/Icon.js'
|
||||
import { Sprite } from '../components/Sprite.js'
|
||||
// import { Toolbar } from '../components/Toolbar.js'
|
||||
|
||||
// import icons from '../data/icons.json'
|
||||
|
||||
const icons = []
|
||||
export default function Index () {
|
||||
// const [icon, setIcon] = useState(icons[0].name),
|
||||
// [strokeWidth, setStrokeWidth] = useState(2),
|
||||
// groups = groupByCategory(icons),
|
||||
// newIcons = icons.filter(i => !i.version)
|
||||
|
||||
return (
|
||||
<div className="container">
|
||||
index
|
||||
|
||||
{/*<Sprite />*/}
|
||||
|
||||
{/*<div className="box">*/}
|
||||
{/* <div className="row mb">*/}
|
||||
{/* <div className="col">*/}
|
||||
|
||||
{/* <div className="icon-preview-wrap">*/}
|
||||
{/* <div className="icon-preview">*/}
|
||||
{/* <Icon name={icon} strokeWidth={strokeWidth} />*/}
|
||||
{/* <Icon name={icon} strokeWidth={strokeWidth} />*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/* <div className="col-aside">*/}
|
||||
|
||||
{/* <h1 className="icon-title">{icon}</h1>*/}
|
||||
|
||||
{/* <div className="mb">*/}
|
||||
{/* <button className="btn"><Icon name={icon} strokeWidth={strokeWidth} /> Button</button>*/}
|
||||
{/* {' '}*/}
|
||||
{/* <button className="btn btn-icon"><Icon name={icon} strokeWidth={strokeWidth} /></button>*/}
|
||||
{/* {' '}*/}
|
||||
{/* <button className="btn btn-link"><Icon name={icon} strokeWidth={strokeWidth} /> Button</button>*/}
|
||||
{/* </div>*/}
|
||||
|
||||
{/* <div className="input-icon mb">*/}
|
||||
{/* <input type="text" className="input" defaultValue="Input value" />*/}
|
||||
{/* <Icon name={icon} strokeWidth={strokeWidth} />*/}
|
||||
{/* </div>*/}
|
||||
|
||||
{/* <div className="input-icon icon-left mb">*/}
|
||||
{/* <Icon name={icon} strokeWidth={strokeWidth} />*/}
|
||||
{/* <input type="text" className="input" placeholder="Input placeholder" />*/}
|
||||
{/* </div>*/}
|
||||
|
||||
{/* <div className="mb">*/}
|
||||
{/* <div className="avatar"><Icon name={icon} strokeWidth={strokeWidth} /></div>*/}
|
||||
{/* {' '}*/}
|
||||
{/* <div className="avatar avatar-sm"><Icon name={icon} strokeWidth={strokeWidth} /></div>*/}
|
||||
{/* {' '}*/}
|
||||
{/* <a href="#"><Icon name={icon} strokeWidth={strokeWidth} /> Link</a>*/}
|
||||
{/* </div>*/}
|
||||
|
||||
{/* <div className="tabs mb">*/}
|
||||
{/* <a className="tab active"><Icon name={icon} strokeWidth={strokeWidth} /> Tab 1</a>*/}
|
||||
{/* <a className="tab">Tab 2</a>*/}
|
||||
{/* <a className="tab">Tab 3</a>*/}
|
||||
{/* </div>*/}
|
||||
|
||||
{/* <div className="mb">*/}
|
||||
{/* <textarea rows="10" className="input"></textarea>*/}
|
||||
{/* </div>*/}
|
||||
|
||||
|
||||
{/* <div className="mt-auto">*/}
|
||||
{/* <input className="input-range" type="range" min="1" max="2.5" step=".25" value={strokeWidth} onChange={(e) => setStrokeWidth(e.target.value)}/>*/}
|
||||
{/* </div>*/}
|
||||
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
|
||||
{/* <div className="mb">*/}
|
||||
{/* <Toolbar*/}
|
||||
{/* items="arrow-back-up,arrow-forward-up,printer,paint|bold,italic,underline,strikethrough,emphasis,baseline|align-left,align-center,align-right,align-justified,line-height|list,list-check,list-numbers|h-1,h-2,h-3,h-4,h-5,h-6,link,photo,table,regex|sort-ascending,sort-descending,sort-ascending-letters,sort-ascending-numbers|indent-increase,indent-decrease|subscript,superscript|minus,omega,chart-area-line,pencil|eraser,settings,typography,letters-case,clear-formatting|parentheses,brackets,braces,terminal|bike,run,swimming,walk,pray,fall,karate|heart,spade,diamonds,clubs|repeat,repeat-once,switch,player-record,player-play,player-pause,player-stop,power,player-skip-forward,player-skip-back,player-track-next,player-track-prev,player-eject" setIcon={setIcon} strokeWidth={strokeWidth}/>*/}
|
||||
{/* </div>*/}
|
||||
|
||||
{/* {newIcons && <>*/}
|
||||
{/* <h2 className="icon-subtitle">New icons ({newIcons.length})</h2>*/}
|
||||
|
||||
{/* <div className="mb">*/}
|
||||
{/* <div className="icons-list">*/}
|
||||
{/* {newIcons.map(i => (*/}
|
||||
{/* <a href="#" className="icons-list-icon" title={i.name} style={!i.category ? { color: '#999' } : {}}>*/}
|
||||
{/* <Icon name={i.name} strokeWidth={strokeWidth} />*/}
|
||||
{/* </a>*/}
|
||||
{/* ))}*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/* </>}*/}
|
||||
|
||||
|
||||
{/*<h2 className="icon-subtitle">{icons.length} icons</h2>*/}
|
||||
|
||||
{/*<div className="mb">*/}
|
||||
{/* {groups.map(category => (*/}
|
||||
{/* <div key={category.name}>*/}
|
||||
{/* <h3 className="category-subtitle">{category.name ? category.name : 'Uncategorized'} <span*/}
|
||||
{/* className="text-muted">({category.items.length})</span></h3>*/}
|
||||
|
||||
{/* <div className="icons-list">*/}
|
||||
{/* {category.items.map(i => (*/}
|
||||
{/* <a href="#" className={clsx('icons-list-icon', {*/}
|
||||
{/* 'new-icon': !i.version*/}
|
||||
{/* })} title={i.name} key={i.name} onClick={() => setIcon(i.name)}>*/}
|
||||
{/* <Icon name={i.name} strokeWidth={strokeWidth} />*/}
|
||||
{/* </a>*/}
|
||||
{/* ))}*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/* ))}*/}
|
||||
{/*</div>*/}
|
||||
{/*</div>*/}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
// import icons from '../data/icons.json'
|
||||
// import { Icon } from '../components/Icon.js'
|
||||
// import { Sprite } from '../components/Sprite.js'
|
||||
|
||||
export default function Tags () {
|
||||
return <>
|
||||
<div className="container">
|
||||
tags
|
||||
{/*<Sprite />*/}
|
||||
|
||||
<div class="box">
|
||||
{/*<table className="table mb">*/}
|
||||
{/* {icons.map(icon => (*/}
|
||||
{/* <tr key={icon.name}>*/}
|
||||
{/* <td className="td-1">*/}
|
||||
{/* <Icon name={icon.name} />*/}
|
||||
{/* </td>*/}
|
||||
{/* <th>{icon.name}</th>*/}
|
||||
{/* <td>{(icon.tags || []).join(', ')}</td>*/}
|
||||
{/* <td>{icon.category}</td>*/}
|
||||
{/* <td>{icon.version}</td>*/}
|
||||
{/* <td>{icon.unicode}</td>*/}
|
||||
{/* </tr>*/}
|
||||
{/* ))}*/}
|
||||
{/*</table>*/}
|
||||
|
||||
{/*<p>Untagged: {{ i }}</p>*/}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
|
@ -2,6 +2,9 @@
|
|||
* @type {import('next').NextConfig}
|
||||
*/
|
||||
const nextConfig = {
|
||||
experimental: {
|
||||
appDir: true,
|
||||
},
|
||||
webpack(config, options) {
|
||||
config.resolve = {
|
||||
...config.resolve,
|
||||
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
|
@ -0,0 +1,30 @@
|
|||
import icons from '../data/icons.json'
|
||||
import { Icon } from '../components/Icon.js'
|
||||
import { Sprite } from '../components/Sprite.js'
|
||||
|
||||
export default function Tags () {
|
||||
return <>
|
||||
<div className="container">
|
||||
<Sprite />
|
||||
|
||||
<div class="box">
|
||||
<table className="table mb">
|
||||
{icons.map(icon => (
|
||||
<tr key={icon.name}>
|
||||
<td className="td-1">
|
||||
<Icon name={icon.name} />
|
||||
</td>
|
||||
<th>{icon.name}</th>
|
||||
<td>{(icon.tags || []).join(', ')}</td>
|
||||
<td>{icon.category}</td>
|
||||
<td>{icon.version}</td>
|
||||
<td>{icon.unicode}</td>
|
||||
</tr>
|
||||
))}
|
||||
</table>
|
||||
|
||||
{/*<p>Untagged: {{ i }}</p>*/}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import glob from 'glob'
|
||||
import matter from 'gray-matter'
|
||||
import { getCurrentDirPath } from './helpers.mjs'
|
||||
|
||||
const currentDirPath = path.dirname(fileURLToPath(import.meta.url))
|
||||
|
||||
const getRawIconData = (content) => {
|
||||
return content
|
||||
|
|
@ -11,7 +12,7 @@ const getRawIconData = (content) => {
|
|||
}
|
||||
|
||||
export const getIcons = () => {
|
||||
return glob.sync(path.join(getCurrentDirPath(), '../src/*.svg')).map(icon => {
|
||||
return glob.sync(path.join(currentDirPath, '../src/*.svg')).map(icon => {
|
||||
const svg = fs.readFileSync(icon, 'utf-8'),
|
||||
name = path.basename(icon, '.svg')
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
"type": "module",
|
||||
"scripts": {
|
||||
"predev": "pnpm run dev:import-icons",
|
||||
"dev": "cd .build/app && next dev",
|
||||
"dev:import-icons": "node ./.build/app/import-icons.mjs",
|
||||
"dev": "cd .build/editor && next dev",
|
||||
"dev:import-icons": "node ./.build/editor/import-icons.mjs",
|
||||
"build": "cd .build/app && next build",
|
||||
"_start": "bundle exec jekyll serve --watch --livereload --trace --livereload_port 8888",
|
||||
"_build": "pnpm run optimize && pnpm run update && pnpm run build:svgs && pnpm run build:icons && pnpm run build:packages && pnpm run preview && pnpm run changelog-image && pnpm run zip && pnpm run update-readme",
|
||||
|
|
|
|||
Loading…
Reference in New Issue