diff --git a/src/app/(core)/error.tsx b/src/app/(core)/error.tsx index 22f0b06..3ca0b61 100644 --- a/src/app/(core)/error.tsx +++ b/src/app/(core)/error.tsx @@ -1,8 +1,7 @@ 'use client'; -import Button from '@/components/ui/Button/Button'; -import Typography from '@/components/ui/Typography/Typography'; import { useEffect } from 'react'; +import { Button, Typography } from '@/components/ui'; import styles from "./error.module.scss" export default function Error({ diff --git a/src/app/(core)/layout.tsx b/src/app/(core)/layout.tsx index f54c0cc..1e52596 100644 --- a/src/app/(core)/layout.tsx +++ b/src/app/(core)/layout.tsx @@ -1,4 +1,4 @@ -import NavigationBar from "@/components/NavigationBar/NavigationBar"; +import { NavigationBar } from "@/components/layout"; import styles from "./layout.module.scss"; export default function CoreLayout({ diff --git a/src/app/(core)/loading.tsx b/src/app/(core)/loading.tsx index 902aa8f..5ffecc4 100644 --- a/src/app/(core)/loading.tsx +++ b/src/app/(core)/loading.tsx @@ -1,4 +1,4 @@ -import Spinner from "@/components/ui/Spinner/Spinner"; +import { Spinner } from "@/components/ui"; import styles from "./loading.module.scss" export default function Loading() { diff --git a/src/app/(core)/page.tsx b/src/app/(core)/page.tsx index 7b3cb88..fe82d0a 100644 --- a/src/app/(core)/page.tsx +++ b/src/app/(core)/page.tsx @@ -1,11 +1,17 @@ import { Suspense } from "react"; -import Horoscope from "@/components/Horoscope/Horoscope"; -import styles from "./page.module.scss"; -import AdvisersSection, { AdvisersSectionSkeleton } from "@/components/AdvisersSection/AdvisersSection"; -import CompatibilitySection, { CompatibilitySectionSkeleton } from "@/components/CompatibilitySection/CompatibilitySection"; -import MeditationSection, { MeditationSectionSkeleton } from "@/components/MeditationSection/MeditationSection"; -import PalmSection, { PalmSectionSkeleton } from "@/components/PalmSection/PalmSection"; import { loadAssistants, loadCompatibility, loadMeditations, loadPalms } from "@/entities/dashboard/loaders"; +import { Horoscope } from "@/components/widgets"; +import { + AdvisersSection, + AdvisersSectionSkeleton, + CompatibilitySection, + CompatibilitySectionSkeleton, + MeditationSection, + MeditationSectionSkeleton, + PalmSection, + PalmSectionSkeleton +} from "@/components/domains/dashboard"; +import styles from "./page.module.scss"; export default function Home() { return ( diff --git a/src/app/layout.tsx b/src/app/layout.tsx index e585687..b7166a0 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,8 +1,8 @@ import type { Metadata } from "next"; import { Inter } from "next/font/google"; import clsx from "clsx"; -import styles from "./layout.module.scss" import "@/styles/globals.css"; +import styles from "./layout.module.scss" const inter = Inter({ subsets: ["latin", "cyrillic"], @@ -11,7 +11,7 @@ const inter = Inter({ }); export const metadata: Metadata = { - title: "Wit Apps | AURA", + title: "WIT", description: "More than 14M people have experienced the value of our products. Wit Apps, headquartered in Silicon Valley, California, is a tech company that constructs global enterprises specializing in mobile-first products. We believe in the transformative power of technology, capable of turning chaos into miracles, thus enhancing the lives of millions. To realize this vision, we integrate leading expertise in artificial intelligence with a deep understanding of consumer needs and lifestyle trends.", }; diff --git a/src/components/Logo/Logo.tsx b/src/components/Logo/Logo.tsx deleted file mode 100644 index 7b66906..0000000 --- a/src/components/Logo/Logo.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import Typography from "../ui/Typography/Typography"; - -export default function Logo() { - return AURA -} \ No newline at end of file diff --git a/src/components/AdviserCard/AdviserCard.module.scss b/src/components/domains/dashboard/cards/AdviserCard/AdviserCard.module.scss similarity index 98% rename from src/components/AdviserCard/AdviserCard.module.scss rename to src/components/domains/dashboard/cards/AdviserCard/AdviserCard.module.scss index d2dba98..c0ed9a0 100644 --- a/src/components/AdviserCard/AdviserCard.module.scss +++ b/src/components/domains/dashboard/cards/AdviserCard/AdviserCard.module.scss @@ -1,4 +1,4 @@ -.card.adviserCard { +.card.card { padding: 0; min-width: 160px; height: 235px; diff --git a/src/components/AdviserCard/AdviserCard.tsx b/src/components/domains/dashboard/cards/AdviserCard/AdviserCard.tsx similarity index 83% rename from src/components/AdviserCard/AdviserCard.tsx rename to src/components/domains/dashboard/cards/AdviserCard/AdviserCard.tsx index 0b03367..1550456 100644 --- a/src/components/AdviserCard/AdviserCard.tsx +++ b/src/components/domains/dashboard/cards/AdviserCard/AdviserCard.tsx @@ -1,10 +1,6 @@ -import clsx from "clsx" -import Button from "../ui/Button/Button" -import Card from "../ui/Card/Card" -import Typography from "../ui/Typography/Typography" -import styles from "./AdviserCard.module.scss" import { Assistant } from "@/entities/dashboard/types" -import Stars from "../ui/Stars/Stars" +import { Button, Card, Stars, Typography } from "@/components/ui" +import styles from "./AdviserCard.module.scss" type AdviserCardProps = Assistant; @@ -16,7 +12,7 @@ export default function AdviserCard({ description }: AdviserCardProps) { return ( - +
diff --git a/src/components/CompatibilityCard/CompatibilityCard.module.scss b/src/components/domains/dashboard/cards/CompatibilityCard/CompatibilityCard.module.scss similarity index 96% rename from src/components/CompatibilityCard/CompatibilityCard.module.scss rename to src/components/domains/dashboard/cards/CompatibilityCard/CompatibilityCard.module.scss index 925e259..03d4b8f 100644 --- a/src/components/CompatibilityCard/CompatibilityCard.module.scss +++ b/src/components/domains/dashboard/cards/CompatibilityCard/CompatibilityCard.module.scss @@ -1,4 +1,4 @@ -.card { +.card.card { padding: 0; min-width: 320px; height: 110px; diff --git a/src/components/CompatibilityCard/CompatibilityCard.tsx b/src/components/domains/dashboard/cards/CompatibilityCard/CompatibilityCard.tsx similarity index 81% rename from src/components/CompatibilityCard/CompatibilityCard.tsx rename to src/components/domains/dashboard/cards/CompatibilityCard/CompatibilityCard.tsx index 1144797..f3e753d 100644 --- a/src/components/CompatibilityCard/CompatibilityCard.tsx +++ b/src/components/domains/dashboard/cards/CompatibilityCard/CompatibilityCard.tsx @@ -1,10 +1,8 @@ import Image from "next/image"; -import Card from "../ui/Card/Card" -import Typography from "../ui/Typography/Typography" -import styles from "./CompatibilityCard.module.scss" -import { IconName } from "../ui/Icon/Icon"; -import MetaLabel from "../ui/MetaLabel/MetaLabel"; import { CompatibilityAction } from "@/entities/dashboard/types"; +import { Card, MetaLabel, Typography } from "@/components/ui"; +import { IconName } from "@/components/ui/Icon/Icon"; +import styles from "./CompatibilityCard.module.scss"; type CompatibilityCardProps = CompatibilityAction; diff --git a/src/components/MeditationCard/MeditationCard.module.scss b/src/components/domains/dashboard/cards/MeditationCard/MeditationCard.module.scss similarity index 98% rename from src/components/MeditationCard/MeditationCard.module.scss rename to src/components/domains/dashboard/cards/MeditationCard/MeditationCard.module.scss index 82a7838..3032cfb 100644 --- a/src/components/MeditationCard/MeditationCard.module.scss +++ b/src/components/domains/dashboard/cards/MeditationCard/MeditationCard.module.scss @@ -1,4 +1,4 @@ -.card { +.card.card { padding: 0; min-width: 342px; height: 308px; diff --git a/src/components/MeditationCard/MeditationCard.tsx b/src/components/domains/dashboard/cards/MeditationCard/MeditationCard.tsx similarity index 88% rename from src/components/MeditationCard/MeditationCard.tsx rename to src/components/domains/dashboard/cards/MeditationCard/MeditationCard.tsx index 8db2cc5..9f1e9ce 100644 --- a/src/components/MeditationCard/MeditationCard.tsx +++ b/src/components/domains/dashboard/cards/MeditationCard/MeditationCard.tsx @@ -1,11 +1,8 @@ import Image from "next/image"; -import Card from "../ui/Card/Card" -import Typography from "../ui/Typography/Typography" -import styles from "./MeditationCard.module.scss" -import Icon, { IconName } from "../ui/Icon/Icon"; -import MetaLabel from "../ui/MetaLabel/MetaLabel"; -import Button from "../ui/Button/Button"; import { Meditation } from "@/entities/dashboard/types"; +import { Button, Card, Icon, MetaLabel, Typography } from "@/components/ui"; +import { IconName } from "@/components/ui/Icon/Icon"; +import styles from "./MeditationCard.module.scss" type MeditationCardProps = Meditation; diff --git a/src/components/PalmCard/PalmCard.module.scss b/src/components/domains/dashboard/cards/PalmCard/PalmCard.module.scss similarity index 97% rename from src/components/PalmCard/PalmCard.module.scss rename to src/components/domains/dashboard/cards/PalmCard/PalmCard.module.scss index c7304df..5b61165 100644 --- a/src/components/PalmCard/PalmCard.module.scss +++ b/src/components/domains/dashboard/cards/PalmCard/PalmCard.module.scss @@ -1,4 +1,4 @@ -.card { +.card.card { padding: 0; min-width: 200px; height: 227px; diff --git a/src/components/PalmCard/PalmCard.tsx b/src/components/domains/dashboard/cards/PalmCard/PalmCard.tsx similarity index 85% rename from src/components/PalmCard/PalmCard.tsx rename to src/components/domains/dashboard/cards/PalmCard/PalmCard.tsx index b0bcbd9..2e8fedf 100644 --- a/src/components/PalmCard/PalmCard.tsx +++ b/src/components/domains/dashboard/cards/PalmCard/PalmCard.tsx @@ -1,10 +1,8 @@ import Image from "next/image"; -import Card from "../ui/Card/Card" -import Typography from "../ui/Typography/Typography" -import styles from "./PalmCard.module.scss" -import { IconName } from "../ui/Icon/Icon"; -import MetaLabel from "../ui/MetaLabel/MetaLabel"; import { PalmAction } from "@/entities/dashboard/types"; +import { Card, MetaLabel, Typography } from "@/components/ui"; +import { IconName } from "@/components/ui/Icon/Icon"; +import styles from "./PalmCard.module.scss"; type PalmCardProps = PalmAction; diff --git a/src/components/domains/dashboard/cards/index.ts b/src/components/domains/dashboard/cards/index.ts new file mode 100644 index 0000000..ae338cb --- /dev/null +++ b/src/components/domains/dashboard/cards/index.ts @@ -0,0 +1,4 @@ +export { default as AdviserCard } from './AdviserCard/AdviserCard'; +export { default as CompatibilityCard } from './CompatibilityCard/CompatibilityCard'; +export { default as MeditationCard } from './MeditationCard/MeditationCard'; +export { default as PalmCard } from './PalmCard/PalmCard'; \ No newline at end of file diff --git a/src/components/domains/dashboard/index.ts b/src/components/domains/dashboard/index.ts new file mode 100644 index 0000000..ad8c17f --- /dev/null +++ b/src/components/domains/dashboard/index.ts @@ -0,0 +1,2 @@ +export * from './cards'; +export * from './sections'; \ No newline at end of file diff --git a/src/components/AdvisersSection/AdvisersSection.module.scss b/src/components/domains/dashboard/sections/AdvisersSection/AdvisersSection.module.scss similarity index 50% rename from src/components/AdvisersSection/AdvisersSection.module.scss rename to src/components/domains/dashboard/sections/AdvisersSection/AdvisersSection.module.scss index 3b7415d..3f6ed21 100644 --- a/src/components/AdvisersSection/AdvisersSection.module.scss +++ b/src/components/domains/dashboard/sections/AdvisersSection/AdvisersSection.module.scss @@ -1,16 +1,10 @@ -.sectionContent { +.sectionContent.sectionContent { overflow-x: scroll; width: calc(100% + 32px); padding: 32px 16px; - padding-right: 0; margin: -32px -16px; - margin-right: 0; } -.grid { - padding-right: 16px; -} - -.advisersSkeleton.skeleton { +.skeleton.skeleton { height: 486px; } \ No newline at end of file diff --git a/src/components/AdvisersSection/AdvisersSection.tsx b/src/components/domains/dashboard/sections/AdvisersSection/AdvisersSection.tsx similarity index 69% rename from src/components/AdvisersSection/AdvisersSection.tsx rename to src/components/domains/dashboard/sections/AdvisersSection/AdvisersSection.tsx index f5f2a0e..8070fae 100644 --- a/src/components/AdvisersSection/AdvisersSection.tsx +++ b/src/components/domains/dashboard/sections/AdvisersSection/AdvisersSection.tsx @@ -1,11 +1,8 @@ import { Assistant } from "@/entities/dashboard/types"; -import AdviserCard from "../AdviserCard/AdviserCard"; -import Grid from "../ui/Grid/Grid" -import Section from "../ui/Section/Section" -import styles from "./AdvisersSection.module.scss" import { use } from "react"; -import Skeleton from "../ui/Skeleton/Skeleton"; -import clsx from "clsx"; +import { AdviserCard } from "../../cards"; +import { Grid, Section, Skeleton } from "@/components/ui"; +import styles from "./AdvisersSection.module.scss"; export default function AdvisersSection({ promise }: { promise: Promise }) { const assistants = use(promise); @@ -25,7 +22,7 @@ export default function AdvisersSection({ promise }: { promise: Promise - + ) } \ No newline at end of file diff --git a/src/components/CompatibilitySection/CompatibilitySection.module.scss b/src/components/domains/dashboard/sections/CompatibilitySection/CompatibilitySection.module.scss similarity index 56% rename from src/components/CompatibilitySection/CompatibilitySection.module.scss rename to src/components/domains/dashboard/sections/CompatibilitySection/CompatibilitySection.module.scss index 8d37ec7..cccd4d6 100644 --- a/src/components/CompatibilitySection/CompatibilitySection.module.scss +++ b/src/components/domains/dashboard/sections/CompatibilitySection/CompatibilitySection.module.scss @@ -1,14 +1,10 @@ -.sectionContent { +.sectionContent.sectionContent { overflow-x: scroll; width: calc(100% + 32px); padding: 16px; margin: -16px; } -.grid { - padding-right: 16px; -} - -.compatibilitySkeleton.skeleton { +.skeleton.skeleton { height: 236px; } \ No newline at end of file diff --git a/src/components/CompatibilitySection/CompatibilitySection.tsx b/src/components/domains/dashboard/sections/CompatibilitySection/CompatibilitySection.tsx similarity index 69% rename from src/components/CompatibilitySection/CompatibilitySection.tsx rename to src/components/domains/dashboard/sections/CompatibilitySection/CompatibilitySection.tsx index 82ecdfc..adb4c5a 100644 --- a/src/components/CompatibilitySection/CompatibilitySection.tsx +++ b/src/components/domains/dashboard/sections/CompatibilitySection/CompatibilitySection.tsx @@ -1,11 +1,8 @@ import { CompatibilityAction } from "@/entities/dashboard/types"; -import CompatibilityCard from "../CompatibilityCard/CompatibilityCard"; -import Grid from "../ui/Grid/Grid" -import Section from "../ui/Section/Section" -import styles from "./CompatibilitySection.module.scss" import { use } from "react"; -import Skeleton from "../ui/Skeleton/Skeleton"; -import clsx from "clsx"; +import { Grid, Section, Skeleton } from "@/components/ui"; +import { CompatibilityCard } from "../../cards"; +import styles from "./CompatibilitySection.module.scss"; export default function CompatibilitySection({ promise }: { promise: Promise }) { const compatibilities = use(promise); @@ -25,7 +22,7 @@ export default function CompatibilitySection({ promise }: { promise: Promise - + ) } \ No newline at end of file diff --git a/src/components/MeditationSection/MeditationSection.module.scss b/src/components/domains/dashboard/sections/MeditationSection/MeditationSection.module.scss similarity index 57% rename from src/components/MeditationSection/MeditationSection.module.scss rename to src/components/domains/dashboard/sections/MeditationSection/MeditationSection.module.scss index d059e8f..049dc30 100644 --- a/src/components/MeditationSection/MeditationSection.module.scss +++ b/src/components/domains/dashboard/sections/MeditationSection/MeditationSection.module.scss @@ -1,14 +1,10 @@ -.sectionContent { +.sectionContent.sectionContent { overflow-x: scroll; width: calc(100% + 32px); padding: 16px; margin: -16px; } -.grid { - padding-right: 16px; -} - -.meditationSkeleton.skeleton { +.skeleton.skeleton { height: 308px; } \ No newline at end of file diff --git a/src/components/MeditationSection/MeditationSection.tsx b/src/components/domains/dashboard/sections/MeditationSection/MeditationSection.tsx similarity index 68% rename from src/components/MeditationSection/MeditationSection.tsx rename to src/components/domains/dashboard/sections/MeditationSection/MeditationSection.tsx index 63a5666..d80fd77 100644 --- a/src/components/MeditationSection/MeditationSection.tsx +++ b/src/components/domains/dashboard/sections/MeditationSection/MeditationSection.tsx @@ -1,11 +1,8 @@ import { Meditation } from "@/entities/dashboard/types"; -import MeditationCard from "../MeditationCard/MeditationCard"; -import Grid from "../ui/Grid/Grid" -import Section from "../ui/Section/Section" -import styles from "./MeditationSection.module.scss" import { use } from "react"; -import Skeleton from "../ui/Skeleton/Skeleton"; -import clsx from "clsx"; +import { Grid, Section, Skeleton } from "@/components/ui"; +import { MeditationCard } from "../../cards"; +import styles from "./MeditationSection.module.scss"; export default function MeditationSection({ promise }: { promise: Promise }) { const meditations = use(promise); @@ -25,7 +22,7 @@ export default function MeditationSection({ promise }: { promise: Promise - + ) } \ No newline at end of file diff --git a/src/components/PalmSection/PalmSection.module.scss b/src/components/domains/dashboard/sections/PalmSection/PalmSection.module.scss similarity index 59% rename from src/components/PalmSection/PalmSection.module.scss rename to src/components/domains/dashboard/sections/PalmSection/PalmSection.module.scss index 88de7bf..d733474 100644 --- a/src/components/PalmSection/PalmSection.module.scss +++ b/src/components/domains/dashboard/sections/PalmSection/PalmSection.module.scss @@ -1,14 +1,10 @@ -.sectionContent { +.sectionContent.sectionContent { overflow-x: scroll; width: calc(100% + 32px); padding: 16px; margin: -16px; } -.grid { - padding-right: 16px; -} - -.palmSkeleton.skeleton { +.skeleton.skeleton { height: 227px; } \ No newline at end of file diff --git a/src/components/PalmSection/PalmSection.tsx b/src/components/domains/dashboard/sections/PalmSection/PalmSection.tsx similarity index 68% rename from src/components/PalmSection/PalmSection.tsx rename to src/components/domains/dashboard/sections/PalmSection/PalmSection.tsx index 270f5c0..09d5a49 100644 --- a/src/components/PalmSection/PalmSection.tsx +++ b/src/components/domains/dashboard/sections/PalmSection/PalmSection.tsx @@ -1,11 +1,8 @@ import { PalmAction } from "@/entities/dashboard/types"; -import PalmCard from "../PalmCard/PalmCard"; -import Grid from "../ui/Grid/Grid" -import Section from "../ui/Section/Section" -import styles from "./PalmSection.module.scss" import { use } from "react"; -import Skeleton from "../ui/Skeleton/Skeleton"; -import clsx from "clsx"; +import { Grid, Section, Skeleton } from "@/components/ui"; +import { PalmCard } from "../../cards"; +import styles from "./PalmSection.module.scss"; export default function PalmSection({ promise }: { promise: Promise }) { const palms = use(promise); @@ -25,7 +22,7 @@ export default function PalmSection({ promise }: { promise: Promise - + ) } \ No newline at end of file diff --git a/src/components/domains/dashboard/sections/index.ts b/src/components/domains/dashboard/sections/index.ts new file mode 100644 index 0000000..4f32d9e --- /dev/null +++ b/src/components/domains/dashboard/sections/index.ts @@ -0,0 +1,4 @@ +export { default as AdvisersSection, AdvisersSectionSkeleton } from './AdvisersSection/AdvisersSection'; +export { default as CompatibilitySection, CompatibilitySectionSkeleton } from './CompatibilitySection/CompatibilitySection'; +export { default as MeditationSection, MeditationSectionSkeleton } from './MeditationSection/MeditationSection'; +export { default as PalmSection, PalmSectionSkeleton } from './PalmSection/PalmSection'; \ No newline at end of file diff --git a/src/components/layout/Logo/Logo.tsx b/src/components/layout/Logo/Logo.tsx new file mode 100644 index 0000000..7b02252 --- /dev/null +++ b/src/components/layout/Logo/Logo.tsx @@ -0,0 +1,5 @@ +import { Typography } from "@/components/ui"; + +export default function Logo() { + return WIT +} \ No newline at end of file diff --git a/src/components/NavigationBar/NavigationBar.module.scss b/src/components/layout/NavigationBar/NavigationBar.module.scss similarity index 100% rename from src/components/NavigationBar/NavigationBar.module.scss rename to src/components/layout/NavigationBar/NavigationBar.module.scss diff --git a/src/components/NavigationBar/NavigationBar.tsx b/src/components/layout/NavigationBar/NavigationBar.tsx similarity index 72% rename from src/components/NavigationBar/NavigationBar.tsx rename to src/components/layout/NavigationBar/NavigationBar.tsx index 0790483..e1776fa 100644 --- a/src/components/NavigationBar/NavigationBar.tsx +++ b/src/components/layout/NavigationBar/NavigationBar.tsx @@ -1,7 +1,8 @@ -import Logo from "../Logo/Logo" -import Icon, { IconName } from "../ui/Icon/Icon" -import styles from "./NavigationBar.module.scss" +import { Icon } from "@/components/ui"; import clsx from "clsx"; +import Logo from "../Logo/Logo"; +import { IconName } from "@/components/ui/Icon/Icon"; +import styles from "./NavigationBar.module.scss"; interface NavigationBarProps { className?: string; diff --git a/src/components/layout/index.ts b/src/components/layout/index.ts new file mode 100644 index 0000000..8df8580 --- /dev/null +++ b/src/components/layout/index.ts @@ -0,0 +1,2 @@ +export { default as Logo } from './Logo/Logo'; +export { default as NavigationBar } from './NavigationBar/NavigationBar'; \ No newline at end of file diff --git a/src/components/ui/MetaLabel/MetaLabel.tsx b/src/components/ui/MetaLabel/MetaLabel.tsx index d73e60e..055d302 100644 --- a/src/components/ui/MetaLabel/MetaLabel.tsx +++ b/src/components/ui/MetaLabel/MetaLabel.tsx @@ -1,7 +1,7 @@ import { ReactNode } from "react"; -import styles from "./MetaLabel.module.scss"; import IconLabel, { IconLabelProps } from "../IconLabel/IconLabel"; import Typography from "../Typography/Typography"; +import styles from "./MetaLabel.module.scss"; export type MetaLabelProps = { iconLabelProps: IconLabelProps; diff --git a/src/components/ui/Section/Section.tsx b/src/components/ui/Section/Section.tsx index 2af641d..18c625c 100644 --- a/src/components/ui/Section/Section.tsx +++ b/src/components/ui/Section/Section.tsx @@ -1,7 +1,7 @@ import { ReactNode } from "react"; import clsx from "clsx"; -import styles from "./Section.module.scss"; import Typography from "../Typography/Typography"; +import styles from "./Section.module.scss"; interface SectionProps { title?: string; diff --git a/src/components/ui/Spinner/Spinner.tsx b/src/components/ui/Spinner/Spinner.tsx index 7dff5b4..9342697 100644 --- a/src/components/ui/Spinner/Spinner.tsx +++ b/src/components/ui/Spinner/Spinner.tsx @@ -1,6 +1,6 @@ import clsx from "clsx"; -import styles from "./styles.module.scss"; import { CSSProperties } from "react"; +import styles from "./styles.module.scss"; export interface SpinnerProps { size?: number | string; diff --git a/src/components/ui/TabBar/TabBar.tsx b/src/components/ui/TabBar/TabBar.tsx index 7e48dd2..707a2be 100644 --- a/src/components/ui/TabBar/TabBar.tsx +++ b/src/components/ui/TabBar/TabBar.tsx @@ -1,6 +1,6 @@ import clsx from "clsx"; -import styles from "./TabBar.module.scss"; import Typography from "../Typography/Typography"; +import styles from "./TabBar.module.scss"; export type Tab = { label: string; diff --git a/src/components/ui/index.ts b/src/components/ui/index.ts new file mode 100644 index 0000000..0afa797 --- /dev/null +++ b/src/components/ui/index.ts @@ -0,0 +1,12 @@ +export { default as Button } from './Button/Button'; +export { default as Card } from './Card/Card'; +export { default as Grid } from './Grid/Grid'; +export { default as Icon } from './Icon/Icon'; +export { default as IconLabel } from './IconLabel/IconLabel'; +export { default as MetaLabel } from './MetaLabel/MetaLabel'; +export { default as Section } from './Section/Section'; +export { default as Skeleton } from './Skeleton/Skeleton'; +export { default as Spinner } from './Spinner/Spinner'; +export { default as Stars } from './Stars/Stars'; +export { default as TabBar } from './TabBar/TabBar'; +export { default as Typography } from './Typography/Typography'; \ No newline at end of file diff --git a/src/components/Horoscope/Horoscope.module.scss b/src/components/widgets/Horoscope/Horoscope.module.scss similarity index 97% rename from src/components/Horoscope/Horoscope.module.scss rename to src/components/widgets/Horoscope/Horoscope.module.scss index 8b1dc2a..29ff406 100644 --- a/src/components/Horoscope/Horoscope.module.scss +++ b/src/components/widgets/Horoscope/Horoscope.module.scss @@ -12,7 +12,7 @@ color: #2A74DD; } -.card { +.card.card { padding: 16px 0px; display: flex; flex-direction: column; diff --git a/src/components/Horoscope/Horoscope.tsx b/src/components/widgets/Horoscope/Horoscope.tsx similarity index 79% rename from src/components/Horoscope/Horoscope.tsx rename to src/components/widgets/Horoscope/Horoscope.tsx index 6353501..46beefa 100644 --- a/src/components/Horoscope/Horoscope.tsx +++ b/src/components/widgets/Horoscope/Horoscope.tsx @@ -1,11 +1,9 @@ "use client"; import { useMemo, useState } from "react"; -import TabBar, { Tab } from "../ui/TabBar/TabBar"; -import Text from "../ui/Typography/Typography"; +import { Button, Card, TabBar, Typography } from "@/components/ui"; +import { Tab } from "@/components/ui/TabBar/TabBar"; import styles from "./Horoscope.module.scss"; -import Card from "../ui/Card/Card"; -import Button from "../ui/Button/Button"; type Period = "today" | "week" | "month" | "year"; @@ -40,16 +38,16 @@ export default function Horoscope() { tabs={TABS} active={active} onChange={setActive} />
- + — Your Horoscope today — - - + + {text} - + {enableCollapse && }
diff --git a/src/components/widgets/index.ts b/src/components/widgets/index.ts new file mode 100644 index 0000000..5de0b00 --- /dev/null +++ b/src/components/widgets/index.ts @@ -0,0 +1 @@ +export { default as Horoscope } from './Horoscope/Horoscope'; \ No newline at end of file diff --git a/src/entities/dashboard/api.ts b/src/entities/dashboard/api.ts index 3aff443..5bc117d 100644 --- a/src/entities/dashboard/api.ts +++ b/src/entities/dashboard/api.ts @@ -1,12 +1,9 @@ import { http } from "@/shared/api/httpClient"; import { DashboardSchema, DashboardData } from "./types"; -import { delay } from "@/shared/utils/delay"; export const getDashboard = async () => { - await delay(3_000); - return http.get("/dashboard", { tags: ["dashboard"], - schema: DashboardSchema, + schema: DashboardSchema }); } \ No newline at end of file diff --git a/src/shared/api/httpClient.ts b/src/shared/api/httpClient.ts index cefe250..efe6110 100644 --- a/src/shared/api/httpClient.ts +++ b/src/shared/api/httpClient.ts @@ -15,6 +15,7 @@ type RequestOpts = Omit & { tags?: string[]; // next.js cache-tag query?: Record; // query-string schema?: z.ZodTypeAny; // runtime validation + revalidate?: number; }; class HttpClient { @@ -35,12 +36,18 @@ class HttpClient { opts: RequestOpts = {}, body?: unknown ): Promise { - const { tags = [], schema, query, ...rest } = opts; + const { + tags = [], + schema, + query, + revalidate = 300, + ...rest + } = opts; const res = await fetch(this.buildUrl(path, query), { method, body: body ? JSON.stringify(body) : undefined, headers: { "Content-Type": "application/json" }, - next: { revalidate: 3600, tags }, + next: { revalidate, tags }, ...rest, });