Skip to content

Commit d933dc6

Browse files
committed
move to a flat components structure, where each component owns its CSS module
1 parent 71a750b commit d933dc6

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

src/components/App.tsx renamed to src/components/App/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import { OAuthResult } from '@huggingface/hub'
33
import { Config, ConfigProvider, Page, getHttpSource } from 'hyperparam'
44
import { useEffect, useMemo, useState } from 'react'
5-
import { fetchOAuth, getLocalOAuth } from '../lib/auth.js'
6-
import { getHuggingFaceSource } from '../lib/huggingfaceSource.js'
7-
import Home from './Home.js'
5+
import { fetchOAuth, getLocalOAuth } from '../../lib/auth.js'
6+
import { getHuggingFaceSource } from '../../lib/huggingfaceSource.js'
7+
import Home from '../Home/Home.js'
88

99
function getRequestInit(accessToken: string | undefined): RequestInit | undefined {
1010
if (!accessToken) return undefined
File renamed without changes.

src/components/Home.tsx renamed to src/components/Home/Home.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { OAuthResult } from '@huggingface/hub'
22
import { FormEvent } from 'react'
3-
import HFLoginIcon from '../assets/sign-in-with-huggingface-lg.svg'
4-
import { login, logout } from '../lib/auth.js'
5-
import { changeQueryString } from '../lib/huggingfaceSource.js'
6-
import styles from '../styles/Home.module.css'
7-
import Search from './Search.js'
3+
import HFLoginIcon from '../../assets/sign-in-with-huggingface-lg.svg'
4+
import { login, logout } from '../../lib/auth.js'
5+
import { changeQueryString } from '../../lib/huggingfaceSource.js'
6+
import Search from '../Search/Search.js'
7+
import styles from './Home.module.css'
88

99
/**
1010
* Home page

src/components/Link.tsx renamed to src/components/Link/Link.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ReactNode } from 'react'
2-
import { changeQueryString } from '../lib/huggingfaceSource.js'
2+
import { changeQueryString } from '../../lib/huggingfaceSource.js'
33

44
// workaround for Hugging Face spaces
55
export default function Link({ url, children, className }: { url?: string; children?: ReactNode; className?: string }) {
File renamed without changes.

src/components/Search.tsx renamed to src/components/Search/Search.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { DatasetEntry, listDatasets } from '@huggingface/hub'
22
import { ChangeEvent, useEffect, useState } from 'react'
3-
import { baseUrl } from '../lib/huggingfaceSource.js'
4-
import styles from '../styles/Search.module.css'
5-
import Link from './Link.js'
3+
import { baseUrl } from '../../lib/huggingfaceSource.js'
4+
import Link from '../Link/Link.js'
5+
import styles from './Search.module.css'
66

77
export default function Search({ accessToken } : { accessToken?: string }) {
88
const [query, setQuery] = useState<string>()

src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'hyperparam/global.css'
33
import 'hyperparam/hyperparam.css'
44
import { StrictMode } from 'react'
55
import { createRoot } from 'react-dom/client'
6-
import App from './components/App.js'
6+
import App from './components/App/App.js'
77

88
const app = document.getElementById('app')
99
if (!app) throw new Error('No app element')

0 commit comments

Comments
 (0)