Skip to content

Commit

Permalink
chore: updated project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
wellitongervickas committed Nov 3, 2023
1 parent 42cf0d7 commit 8f405ee
Show file tree
Hide file tree
Showing 43 changed files with 99 additions and 159 deletions.
15 changes: 4 additions & 11 deletions app.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
import { Locales } from './locales/locales'

export const socialMedia = [
{
label: 'Twitter',
href: 'https://twitter.com/0xdevhub',
icon: 'twitter'
},
{
label: 'Discord',
href: 'https://discord.gg/skvN5fnt5M',
icon: 'discord'
label: 'X',
href: 'https://x.com/gervickasjs',
icon: 'x'
},
{
label: 'Github',
Expand All @@ -21,7 +14,7 @@ export const socialMedia = [
const appConfig = {
name: '0xdevhub',
meta: {
description: 'on-chain & off-chain dev hub'
description: 'gervickas.js blockchain app hub'
},
socialMedia
}
Expand Down
7 changes: 3 additions & 4 deletions app/[locale]/apps/components/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import { Locales } from '@/locales/locales'
import { useI18n } from '@/locales/client'
import { HeadingNavigation } from '@/app/components/typography'
import { Typography } from '@/app/components'
import { Text, HeadingNavigation } from '@/app/components/typography'

export const AppsContainer = () => {
const t = useI18n()
Expand All @@ -12,10 +11,10 @@ export const AppsContainer = () => {
<div className='w-full p-6'>
<div className='flex flex-col space-y-4'>
<HeadingNavigation as='h2'>{t(Locales.APPS)}</HeadingNavigation>
<Typography.Text className='max-w-lg' variant='span'>
<Text className='max-w-lg' variant='span'>
Enjoy thousand of the latest ethereum apps, games, music, movies, TV,
books, magazines & more. Anytime, anywhere, across your devices.
</Typography.Text>
</Text>
</div>
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/apps/components/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default as Container } from './Container'
export { default as AppsContainer } from './Container'
5 changes: 0 additions & 5 deletions app/[locale]/apps/loading.tsx

This file was deleted.

5 changes: 3 additions & 2 deletions app/[locale]/components/MaintenanceMode.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Logo, Social } from '@/app/components'
import { Logo } from '@/app/components'
import { SocialMedia } from '@/app/components/social'

export const MaintenanceMode = () => {
return (
Expand All @@ -7,7 +8,7 @@ export const MaintenanceMode = () => {
<Logo />
</div>
<div>
<Social className='text-black/40' />
<SocialMedia className='text-black/40' />
</div>
</main>
)
Expand Down
6 changes: 3 additions & 3 deletions app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import { type ReactNode } from 'react'
import { useDarkMode, useIsClient } from 'usehooks-ts'
import classNames from 'classnames'
import { MaintenanceMode } from './components/MaintenanceMode'
import StyledJsxRegistry from '@/app/registry'
import { Header, Footer } from '@/app/components'
import { WalletProvider } from '../components/wallet/Provider'
import { LanguageProvider } from '../components/language'
import { MaintenanceMode } from '@/app/[locale]/components/MaintenanceMode'
import { Provider as WalletProvider } from '@/app/components/wallet'
import { Provider as LanguageProvider } from '@/app/components/language'

export type BaseLayoutProps = {
children: ReactNode
Expand Down
5 changes: 2 additions & 3 deletions app/components/card/Card.tsx → app/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export const Card = ({
bgOpacity = 0.6,
as: Component = 'div',
...props
}: CardProps) => {
return createElement(
}: CardProps) =>
createElement(
Component,
{
...props,
Expand All @@ -28,6 +28,5 @@ export const Card = ({
},
children
)
}

export default Card
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { type HTMLProps } from 'react'
import dynamic from 'next/dynamic'
import classNames from 'classnames'
import { Separator, Logo, Loading, Navigation } from '@/app/components'
import { Separator, Logo, Loading } from '@/app/components'
import { Locales } from '@/locales/locales'
import { MainNav } from '@/app/components/navigation/main/Main'

const Wallet = dynamic(() => import('@/app/components/wallet/Wallet'), {
ssr: false,
Expand All @@ -24,7 +25,7 @@ export const Header = ({ className, ...props }: HTMLProps<HTMLDivElement>) => {
>
<Logo />
<div className='flex items-center space-x-4'>
<Navigation.MainNavigation
<MainNav
navLinks={[
{
label: Locales.APPS,
Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions app/components/card/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions app/components/footer/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions app/components/header/index.ts

This file was deleted.

15 changes: 4 additions & 11 deletions app/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
export { default as Button } from './Button'
export { default as Loading } from './Loading'
export { default as Separator } from './Separator'
export { default as Card } from './card'
export { default as Footer } from './footer'
export { default as Header } from './header'
export { default as Language } from './language'
export { default as Logo } from './logo'
export * as Navigation from './navigation'
export { default as Settings } from './settings'
export { default as Social } from './social'
export { default as Theme } from './theme'
export * as Typography from './typography'
export { default as Wallet } from './wallet'
export { default as Card } from './Card'
export { default as Footer } from './Footer'
export { default as Header } from './Header'
export { default as Logo } from './Logo'
6 changes: 3 additions & 3 deletions app/components/language/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import classNames from 'classnames'
import { useChangeLocale, useCurrentLocale } from '@/locales/client'
import { localeConfig, Locale } from '@/locales/config'
import { CheckBadgeIcon } from '@heroicons/react/24/solid'
import { Typography } from '..'
import { Text } from '@/app/components/typography'

export const LanguageList = (props: HTMLProps<HTMLUListElement>) => {
const currentLocale = useCurrentLocale()
Expand All @@ -25,9 +25,9 @@ export const LanguageList = (props: HTMLProps<HTMLUListElement>) => {
'flex cursor-pointer items-center justify-between space-x-2 p-2'
)}
>
<Typography.Text as='span' className='capitalize'>
<Text as='span' className='capitalize'>
{locale}
</Typography.Text>
</Text>
{locale === currentLocale && (
<CheckBadgeIcon width={18} className='text-green-400' />
)}
Expand Down
6 changes: 3 additions & 3 deletions app/components/language/Selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type HTMLProps } from 'react'
import { ChevronDownIcon } from '@heroicons/react/24/solid'
import classNames from 'classnames'
import { useCurrentLocale } from '@/locales/client'
import { Typography } from '..'
import { Text } from '@/app/components/typography'

export type LanguageSelectorProps = HTMLProps<HTMLDivElement> & {
isOpen?: boolean
Expand All @@ -24,9 +24,9 @@ export const LanguageSelector = ({
'flex cursor-pointer justify-between'
)}
>
<Typography.Text as='span' className='capitalize'>
<Text as='span' className='capitalize'>
{currentLocale}
</Typography.Text>
</Text>
<ChevronDownIcon
width={18}
className={classNames('transform', {
Expand Down
13 changes: 4 additions & 9 deletions app/components/language/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
export { default as LanguageProvider } from './Provider'
export { default as LanguageSelector } from './Selector'
export { default as LanguageList } from './List'

import { Language } from './Language'

export { Language }

export default Language
export { default as Provider } from './Provider'
export { default as Selector } from './Selector'
export { default as List } from './List'
export { default as Language } from './Language'
5 changes: 0 additions & 5 deletions app/components/logo/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion app/components/navigation/aside/AsideNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Children, type HTMLProps, type ReactNode } from 'react'
import { Card } from '@/app/components/card/Card'
import { Card } from '@/app/components/Card'
import classNames from 'classnames'

import {
Expand Down
6 changes: 3 additions & 3 deletions app/components/navigation/aside/AsideNavigationItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link, { LinkProps } from 'next/link'
import classNames from 'classnames'
import { type HTMLProps, type ReactNode } from 'react'
import useCurrentPath from '@/app/lib/hooks/useCurrentPath'
import { Typography } from '../..'
import { Text } from '@/app/components/typography'

export type AsideNavigationItemProps = HTMLProps<HTMLAnchorElement> &
LinkProps & {
Expand Down Expand Up @@ -37,9 +37,9 @@ export const AsideNavigationItem = ({
)}
>
{icon}
<Typography.Text size='md' className='hidden lg:block'>
<Text size='md' className='hidden lg:block'>
{label}
</Typography.Text>
</Text>
</Link>
)
}
Expand Down
7 changes: 1 addition & 6 deletions app/components/navigation/aside/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
export { default as AsideNavigationItem } from './AsideNavigationItem'

import { AsideNavigation } from './AsideNavigation'

export { AsideNavigation }

export default AsideNavigation
export { default as AsideNavigation } from './AsideNavigation'
4 changes: 2 additions & 2 deletions app/components/navigation/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as AsideNavigation } from './aside'
export { default as MainNavigation } from './main'
export * as Aside from './aside'
export * as Main from './main'
6 changes: 3 additions & 3 deletions app/components/navigation/main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { useEffect, type HTMLProps, useCallback } from 'react'
import classNames from 'classnames'
import { ArrowLeftIcon, Bars3BottomLeftIcon } from '@heroicons/react/24/solid'
import { useToggle, useMediaQuery } from 'usehooks-ts'
import { Card } from '@/app/components/card/Card'
import { Card } from '@/app/components/Card'
import { MainList } from './MainList'
import { MainListItemProps } from './MainListItem'

type MainProps = HTMLProps<HTMLElement> & {
navLinks: MainListItemProps[]
}

export const Main = ({ navLinks, ...props }: MainProps) => {
export const MainNav = ({ navLinks, ...props }: MainProps) => {
const [isOpened, toggle] = useToggle()
const matches = useMediaQuery(`(min-width: 1024px`)

Expand Down Expand Up @@ -77,4 +77,4 @@ export const Main = ({ navLinks, ...props }: MainProps) => {
)
}

export default Main
export default MainNav
4 changes: 2 additions & 2 deletions app/components/navigation/main/MainListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import classNames from 'classnames'
import { useI18n } from '@/locales/client'
import { LocalesKeys } from '@/locales/locales'
import useCurrentPath from '@/app/lib/hooks/useCurrentPath'
import { Typography } from '../..'
import { Text } from '@/app/components/typography'

export const Variant = {
default: {
Expand Down Expand Up @@ -49,7 +49,7 @@ export const MainListItem = ({
: Variant[variant || 'default'].classes
])}
>
<Typography.Text size='base'>{t(label)}</Typography.Text>
<Text size='base'>{t(label)}</Text>
</Link>
)
}
Expand Down
7 changes: 1 addition & 6 deletions app/components/navigation/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
export { default as MainList } from './MainList'
export { default as MainListItem } from './MainListItem'

import { Main } from './Main'

export { Main }

export default Main
export { default as MainNav } from './Main'
4 changes: 3 additions & 1 deletion app/components/settings/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import { type HTMLProps } from 'react'
import classNames from 'classnames'
import { Heading } from '@/app/components/typography/Heading'
import { Language, Theme } from '@/app/components'

import { useI18n } from '@/locales/client'
import { Locales } from '@/locales/locales'
import { Theme } from '@/app/components/theme'
import { Language } from '@/app/components/language'

export const SettingsContainer = (props: HTMLProps<HTMLDivElement>) => {
const t = useI18n()
Expand Down
7 changes: 1 addition & 6 deletions app/components/settings/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
export { default as SettingsSelector } from './Selector'
export { default as SettingsContainer } from './Container'

import { Settings } from './Settings'

export { Settings }

export default Settings
export { default as Settings } from './Settings'
4 changes: 2 additions & 2 deletions app/components/social/SocialMedia.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Children, type HTMLProps, type SVGProps } from 'react'
import { Discord, Twitter, Github } from './icons'
import { Discord, X, Github } from './icons'
import classNames from 'classnames'
import { socialMedia } from '@/app.config'
import Link from 'next/link'
Expand Down Expand Up @@ -29,7 +29,7 @@ export const SocialMedia = ({
{
{
discord: <Discord {...iconProps} />,
twitter: <Twitter {...iconProps} />,
x: <X {...iconProps} />,
github: <Github {...iconProps} />
}[icon]
}
Expand Down
20 changes: 20 additions & 0 deletions app/components/social/icons/X.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { type SVGProps } from 'react'

export const XIcon = (props: SVGProps<SVGSVGElement>) => (
<svg
width='24'
height='24'
fill='none'
viewBox='0 0 24 24'
aria-hidden='true'
{...props}
>
<g>
<path
fill='currentColor'
d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'
></path>
</g>
</svg>
)
export default XIcon
1 change: 1 addition & 0 deletions app/components/social/icons/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as Discord } from './Discord'
export { default as Twitter } from './Twitter'
export { default as Github } from './Github'
export { default as X } from './X'
6 changes: 1 addition & 5 deletions app/components/social/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
export * as SocialIcons from './icons'

import { SocialMedia } from './SocialMedia'

export { SocialMedia }

export default SocialMedia
export { default as SocialMedia } from './SocialMedia'
Loading

0 comments on commit 8f405ee

Please sign in to comment.