Update components folder structure to be section-based (#143)
This commit is contained in:
parent
b826372fbc
commit
d0146bb384
54 changed files with 99 additions and 96 deletions
|
|
@ -84,7 +84,8 @@
|
|||
|
||||
// Imports and exports order.
|
||||
"simple-import-sort/imports": 2,
|
||||
"simple-import-sort/exports": 2
|
||||
"simple-import-sort/exports": 2,
|
||||
"import/order": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
---
|
||||
import Icon from '@/atoms/icon';
|
||||
import type { IconName } from '@/types/icon';
|
||||
|
||||
import Icon from './icon';
|
||||
|
||||
type IconButtonSize = 'small' | 'large';
|
||||
|
||||
export interface Props {
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
import type { IconProps } from './icon';
|
||||
import Icon from './icon';
|
||||
import Icon, { IconProps } from './icon';
|
||||
import Tooltip, { TooltipProps } from './tooltip';
|
||||
|
||||
type Props = IconProps & Omit<TooltipProps, 'children'>;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import { useLocation } from 'react-use';
|
||||
|
||||
import Icon from '@/atoms/icon';
|
||||
import type { Section } from '@/types/data';
|
||||
import type { IconName } from '@/types/icon';
|
||||
|
||||
import Icon from './icon';
|
||||
import Tooltip from './tooltip';
|
||||
|
||||
export interface SidebarItemProps {
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
---
|
||||
import Icon from '@/atoms/icon';
|
||||
import type { IconName } from '@/types/icon';
|
||||
|
||||
import Icon from './icon';
|
||||
|
||||
export interface Props {
|
||||
name?: IconName;
|
||||
color?: string;
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
---
|
||||
import TagComponent from '@/atoms/tag.astro';
|
||||
import type { Tag } from '@/types/common';
|
||||
|
||||
import TagComponent from './tag.astro';
|
||||
|
||||
export interface Props {
|
||||
tags: Tag[];
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import Typography from './typography.astro';
|
||||
|
||||
export interface Props {
|
||||
startDate: Date;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import Button from '@/atoms/button.astro';
|
||||
import Button from '@/components/button.astro';
|
||||
---
|
||||
|
||||
<div class="p-5">
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
import BookTile from '@/atoms/book-tile.astro';
|
||||
import MediaTile from '@/atoms/media-tile.astro';
|
||||
import PersonTile from '@/atoms/person-tile.astro';
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import VideoTile from '@/atoms/video-tile.astro';
|
||||
import Typography from '@/components/typography.astro';
|
||||
import BookTile from '@/sections/favorites/book-tile.astro';
|
||||
import MediaTile from '@/sections/favorites/media-tile.astro';
|
||||
import PersonTile from '@/sections/favorites/person-tile.astro';
|
||||
import VideoTile from '@/sections/favorites/video-tile.astro';
|
||||
import type { Book, Media, Person, Video } from '@/types/favorites-section';
|
||||
|
||||
const book: Book = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import IconButton from '@/atoms/icon-button.astro';
|
||||
import IconButton from '@/components/icon-button.astro';
|
||||
---
|
||||
|
||||
<div class="flex flex-col gap-2 p-5">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import Icon from '@/atoms/icon';
|
||||
import Icon from '@/components/icon';
|
||||
---
|
||||
|
||||
<div class="p-5">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import LabelledValue from '@/atoms/labelled-value.astro';
|
||||
import LabelledValue from '@/components/labelled-value.astro';
|
||||
---
|
||||
|
||||
<div class="p-5">
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
---
|
||||
import MainSection from '@/sections/main-section.astro';
|
||||
import MainSection from '@/sections/main/main-section.astro';
|
||||
import type { MainSection as MainSectionData } from '@/types/main-section';
|
||||
|
||||
const mainSectionData: MainSectionData = {
|
||||
config: {
|
||||
icon: 'fa6-solid:user',
|
||||
title: 'About me',
|
||||
},
|
||||
image: import('@/assets/my-image.jpeg'),
|
||||
fullName: 'Mark Freeman',
|
||||
role: 'Senior React Developer',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import ProjectTimelineItem from '@/organisms/project-timeline-item.astro';
|
||||
import ProjectTimelineItem from '@/sections/portfolio/project-timeline-item.astro';
|
||||
import type { I18n } from '@/types/i18n';
|
||||
import type { Project } from '@/types/portfolio-section';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
import SectionCard from '@/atoms/section-card.astro';
|
||||
import SectionCard from '@/components/section-card.astro';
|
||||
---
|
||||
|
||||
<div class="p-5">
|
||||
<SectionCard>SectionCard text</SectionCard>
|
||||
<SectionCard section="main">SectionCard text</SectionCard>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import SidebarItem from '@/atoms/sidebar-item';
|
||||
import SidebarItem from '@/components/sidebar-item';
|
||||
---
|
||||
|
||||
<div class="p-5">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
import SidebarItem from '@/atoms/sidebar-item';
|
||||
import Sidebar from '@/organisms/sidebar.astro';
|
||||
import Sidebar from '@/components/sidebar.astro';
|
||||
import SidebarItem from '@/components/sidebar-item';
|
||||
---
|
||||
|
||||
<div class="relative p-5">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import Skill from '@/organisms/skill.astro';
|
||||
import Skill from '@/sections/skills/skill.astro';
|
||||
import type { LevelledSkill } from '@/types/skills-section';
|
||||
|
||||
const levelledSkill: LevelledSkill = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import SkillsSection from '@/sections/skills-section.astro';
|
||||
import SkillsSection from '@/sections/skills/skills-section.astro';
|
||||
import type { SkillsSection as SkillsSectionData } from '@/types/skills-section';
|
||||
|
||||
const skills: SkillsSectionData = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import Tag from '@/atoms/tag.astro';
|
||||
import Tag from '@/components/tag.astro';
|
||||
---
|
||||
|
||||
<div class="p-5">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import Testimonial from '@/organisms/testimonial.astro';
|
||||
import Testimonial from '@/sections/testimonials/testimonial.astro';
|
||||
import type { Testimonial as TestimonialData } from '@/types/testimonials-section';
|
||||
|
||||
const testimonial: TestimonialData = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import TestimonialsSection from '@/sections/testimonials-section.astro';
|
||||
import TestimonialsSection from '@/sections/testimonials/testimonials-section.astro';
|
||||
import type { Testimonial } from '@/types/testimonials-section';
|
||||
|
||||
const testimonials: Testimonial[] = [
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import Typography from '@/components/typography.astro';
|
||||
|
||||
const text = 'A quick brown fox jumps over the lazy dog';
|
||||
---
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import WorkTimelineItem from '@/organisms/work-timeline-item.astro';
|
||||
import WorkTimelineItem from '@/sections/experience/work-timeline-item.astro';
|
||||
import type { Job } from '@/types/experience-section';
|
||||
import type { I18n } from '@/types/i18n';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
import SidebarItem from '@/atoms/sidebar-item';
|
||||
import ThemeToggle from '@/atoms/theme-icon';
|
||||
import Sidebar from '@/organisms/sidebar.astro';
|
||||
import ExperienceSection from '@/sections/experience-section.astro';
|
||||
import FavoritesSection from '@/sections/favorites-section.astro';
|
||||
import MainSection from '@/sections/main-section.astro';
|
||||
import PortfolioSection from '@/sections/portfolio-section.astro';
|
||||
import SkillsSection from '@/sections/skills-section.astro';
|
||||
import TestimonialsSection from '@/sections/testimonials-section.astro';
|
||||
import Sidebar from '@/components/sidebar.astro';
|
||||
import SidebarItem from '@/components/sidebar-item';
|
||||
import ThemeToggle from '@/components/theme-icon';
|
||||
import ExperienceSection from '@/sections/experience/experience-section.astro';
|
||||
import FavoritesSection from '@/sections/favorites/favorites-section.astro';
|
||||
import MainSection from '@/sections/main/main-section.astro';
|
||||
import PortfolioSection from '@/sections/portfolio/portfolio-section.astro';
|
||||
import SkillsSection from '@/sections/skills/skills-section.astro';
|
||||
import TestimonialsSection from '@/sections/testimonials/testimonials-section.astro';
|
||||
import getObjectKeys from '@/utils/getObjectKeys';
|
||||
|
||||
import data from '../data';
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
---
|
||||
import DividedList from '@/atoms/divided-list.astro';
|
||||
import Divider from '@/atoms/divider.astro';
|
||||
import SectionCard from '@/atoms/section-card.astro';
|
||||
import WorkTimelineItem from '@/organisms/work-timeline-item.astro';
|
||||
import DividedList from '@/components/divided-list.astro';
|
||||
import Divider from '@/components/divider.astro';
|
||||
import SectionCard from '@/components/section-card.astro';
|
||||
import type { Section } from '@/types/data';
|
||||
import type { ExperienceSection, Job } from '@/types/experience-section';
|
||||
import type { I18n } from '@/types/i18n';
|
||||
import removeLast from '@/utils/remove-last';
|
||||
|
||||
import WorkTimelineItem from './work-timeline-item.astro';
|
||||
|
||||
export interface Props extends ExperienceSection {
|
||||
jobs: Job[];
|
||||
i18n: I18n;
|
||||
|
|
@ -1,12 +1,11 @@
|
|||
---
|
||||
import IconButton from '@/atoms/icon-button.astro';
|
||||
import Timestamp from '@/atoms/timestamp.astro';
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import IconButton from '@/components/icon-button.astro';
|
||||
import TagsList from '@/components/tags-list.astro';
|
||||
import Timestamp from '@/components/timestamp.astro';
|
||||
import Typography from '@/components/typography.astro';
|
||||
import type { Job } from '@/types/experience-section';
|
||||
import type { I18n } from '@/types/i18n';
|
||||
|
||||
import TagsList from '../molecules/tags-list.astro';
|
||||
|
||||
export interface Props {
|
||||
job: Job;
|
||||
i18n: I18n;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
import { Image } from '@astrojs/image/components';
|
||||
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import Typography from '@/components/typography.astro';
|
||||
import type { Book } from '@/types/favorites-section';
|
||||
|
||||
export interface Props {
|
||||
|
|
@ -1,15 +1,16 @@
|
|||
---
|
||||
import type { ComponentInstance } from 'astro';
|
||||
|
||||
import BookTile from '@/atoms/book-tile.astro';
|
||||
import MediaTile from '@/atoms/media-tile.astro';
|
||||
import PersonTile from '@/atoms/person-tile.astro';
|
||||
import SectionCard from '@/atoms/section-card.astro';
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import VideoTile from '@/atoms/video-tile.astro';
|
||||
import SectionCard from '@/components/section-card.astro';
|
||||
import Typography from '@/components/typography.astro';
|
||||
import type { Section } from '@/types/data';
|
||||
import type { Book, FavoritesSection, Media, Person, Video } from '@/types/favorites-section';
|
||||
|
||||
import BookTile from './book-tile.astro';
|
||||
import MediaTile from './media-tile.astro';
|
||||
import PersonTile from './person-tile.astro';
|
||||
import VideoTile from './video-tile.astro';
|
||||
|
||||
export interface Props extends FavoritesSection {}
|
||||
|
||||
const {
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
import { Image } from '@astrojs/image/components';
|
||||
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import Typography from '@/components/typography.astro';
|
||||
import type { Media } from '@/types/favorites-section';
|
||||
|
||||
export interface Props {
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
import { Image } from '@astrojs/image/components';
|
||||
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import Typography from '@/components/typography.astro';
|
||||
import type { Person } from '@/types/favorites-section';
|
||||
|
||||
export interface Props {
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
import { Image } from '@astrojs/image/components';
|
||||
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import Typography from '@/components/typography.astro';
|
||||
import type { Video } from '@/types/favorites-section';
|
||||
|
||||
export interface Props {
|
||||
|
|
@ -1,15 +1,14 @@
|
|||
---
|
||||
import { Image } from '@astrojs/image/components';
|
||||
|
||||
import Button from '@/atoms/button.astro';
|
||||
import IconButton from '@/atoms/icon-button.astro';
|
||||
import SectionCard from '@/atoms/section-card.astro';
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import Button from '@/components/button.astro';
|
||||
import IconButton from '@/components/icon-button.astro';
|
||||
import SectionCard from '@/components/section-card.astro';
|
||||
import TagsList from '@/components/tags-list.astro';
|
||||
import Typography from '@/components/typography.astro';
|
||||
import type { Section } from '@/types/data';
|
||||
import type { MainSection } from '@/types/main-section';
|
||||
|
||||
import TagsList from '../molecules/tags-list.astro';
|
||||
|
||||
export interface Props extends MainSection {}
|
||||
|
||||
const {
|
||||
|
|
@ -1,13 +1,14 @@
|
|||
---
|
||||
import DividedList from '@/atoms/divided-list.astro';
|
||||
import Divider from '@/atoms/divider.astro';
|
||||
import SectionCard from '@/atoms/section-card.astro';
|
||||
import ProjectTimelineItem from '@/organisms/project-timeline-item.astro';
|
||||
import DividedList from '@/components/divided-list.astro';
|
||||
import Divider from '@/components/divider.astro';
|
||||
import SectionCard from '@/components/section-card.astro';
|
||||
import type { Section } from '@/types/data';
|
||||
import type { I18n } from '@/types/i18n';
|
||||
import type { PortfolioSection } from '@/types/portfolio-section';
|
||||
import removeLast from '@/utils/remove-last';
|
||||
|
||||
import ProjectTimelineItem from './project-timeline-item.astro';
|
||||
|
||||
export interface Props extends PortfolioSection {
|
||||
i18n: I18n;
|
||||
}
|
||||
|
|
@ -1,15 +1,14 @@
|
|||
---
|
||||
import { Image } from '@astrojs/image/components';
|
||||
|
||||
import IconButton from '@/atoms/icon-button.astro';
|
||||
import LabelledValue from '@/atoms/labelled-value.astro';
|
||||
import Timestamp from '@/atoms/timestamp.astro';
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import IconButton from '@/components/icon-button.astro';
|
||||
import LabelledValue from '@/components/labelled-value.astro';
|
||||
import TagsList from '@/components/tags-list.astro';
|
||||
import Timestamp from '@/components/timestamp.astro';
|
||||
import Typography from '@/components/typography.astro';
|
||||
import type { I18n } from '@/types/i18n';
|
||||
import type { Project } from '@/types/portfolio-section';
|
||||
|
||||
import TagsList from '../molecules/tags-list.astro';
|
||||
|
||||
export interface Props {
|
||||
project: Project;
|
||||
i18n: I18n;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import SkillLevelTile from '@/atoms/skill-level-tile.astro';
|
||||
import SkillLevelTile from './skill-level-tile.astro';
|
||||
|
||||
export interface Props {
|
||||
skillLevel: number;
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import TagsList from '@/components/tags-list.astro';
|
||||
import Typography from '@/components/typography.astro';
|
||||
import type { Tag } from '@/types/common';
|
||||
import type { LevelledSkill, SkillSet } from '@/types/skills-section';
|
||||
|
||||
import TagsList from '../molecules/tags-list.astro';
|
||||
import LevelledSkillSubsection from './levelled-skill-subsection.astro';
|
||||
|
||||
export interface Props {
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
---
|
||||
import Icon from '@/atoms/icon';
|
||||
import IconWithTooltip from '@/atoms/icon-with-tooltip';
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import IconWithTooltip from '@/components/icon-with-tooltip';
|
||||
import Typography from '@/components/typography.astro';
|
||||
import type { IconName } from '@/types/icon';
|
||||
import type { LevelledSkill } from '@/types/skills-section';
|
||||
|
||||
import Icon from '../../components/icon';
|
||||
import SkillLevel from './skill-level.astro';
|
||||
|
||||
export interface Props extends LevelledSkill {}
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
---
|
||||
import SectionCard from '@/atoms/section-card.astro';
|
||||
import SkillSubsection from '@/organisms/skill-subsection.astro';
|
||||
import SectionCard from '@/components/section-card.astro';
|
||||
import type { Section } from '@/types/data';
|
||||
import type { SkillsSection } from '@/types/skills-section';
|
||||
|
||||
import SkillSubsection from './skill-subsection.astro';
|
||||
|
||||
export interface Props extends SkillsSection {}
|
||||
|
||||
const {
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
import { Image } from '@astrojs/image/components';
|
||||
|
||||
import IconButton from '@/atoms/icon-button.astro';
|
||||
import Typography from '@/atoms/typography.astro';
|
||||
import IconButton from '@/components/icon-button.astro';
|
||||
import Typography from '@/components/typography.astro';
|
||||
import type { Testimonial } from '@/types/testimonials-section';
|
||||
|
||||
export interface Props {
|
||||
|
|
@ -1,12 +1,13 @@
|
|||
---
|
||||
import DividedList from '@/atoms/divided-list.astro';
|
||||
import Divider from '@/atoms/divider.astro';
|
||||
import SectionCard from '@/atoms/section-card.astro';
|
||||
import Testimonial from '@/organisms/testimonial.astro';
|
||||
import DividedList from '@/components/divided-list.astro';
|
||||
import Divider from '@/components/divider.astro';
|
||||
import SectionCard from '@/components/section-card.astro';
|
||||
import type { Section } from '@/types/data';
|
||||
import type { TestimonialsSection } from '@/types/testimonials-section';
|
||||
import removeLast from '@/utils/remove-last';
|
||||
|
||||
import Testimonial from './testimonial.astro';
|
||||
|
||||
export interface Props extends TestimonialsSection {}
|
||||
|
||||
const {
|
||||
|
|
@ -32,13 +32,7 @@
|
|||
// Add aliases for common paths.
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/atoms/*": ["src/components/atoms/*"],
|
||||
"@/organisms/*": ["src/components/organisms/*"],
|
||||
"@/sections/*": ["src/components/sections/*"],
|
||||
"@/assets/*": ["src/assets/*"],
|
||||
"@/types/*": ["src/types/*"],
|
||||
"@/constants/*": ["src/constants/*"],
|
||||
"@/utils/*": ["src/utils/*"]
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["**/*.ts", "**/*.tsx", "**/*.cjs", "**/*.astro"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue