Skip to content

Commit

Permalink
refactor component structure, scss files for specific component styling
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewheeler committed Oct 31, 2024
1 parent 93f1115 commit 9780828
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 316 deletions.
2 changes: 1 addition & 1 deletion src/app/case-studies/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Hero from '../components/Hero';
import Hero from '../components/Hero/Hero';

export default function CaseStudies() {
return (
Expand Down
11 changes: 11 additions & 0 deletions src/app/components/Footer/Footer.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@media (min-width: 1024px) {
.navbarLogoText {
font-size: 22px;
}
}

@media (max-width: 1024px) {
.navbarLogoText {
font-size: 13px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { PrimaryNav } from '@trussworks/react-uswds';
import Link from 'next/link';
import Image from 'next/image';
import React from 'react';
import styles from '../styles/Home.module.scss';
import { NavigationLink } from './NavigationLink';
import { NavigationLink } from '../NavigationLink/NavigationLink';
import classNames from 'classnames';
import { basePath } from '../utils/constants';
import { basePath } from '../../utils/constants';
import styles from './Footer.module.scss';

export default function Footer() {
const [expanded, setExpanded] = React.useState(false);
Expand All @@ -15,24 +15,16 @@ export default function Footer() {
};

const testItemsMenu = [
<Link
key="one"
href="/"
className={classNames('usa-nav__link', styles.homeNavItem)}
onClick={onClick}
>
<span className={styles.navbarItemText}>Home</span>
</Link>,
<NavigationLink key="two" href="/" onClick={onClick}>
<NavigationLink key="one" href="/" onClick={onClick}>
Home
</NavigationLink>,
<NavigationLink key="three" href="/our-products" onClick={onClick}>
<NavigationLink key="two" href="/our-products" onClick={onClick}>
Our products
</NavigationLink>,
<NavigationLink key="four" href="/case-studies" onClick={onClick}>
<NavigationLink key="three" href="/case-studies" onClick={onClick}>
Case studies
</NavigationLink>,
<NavigationLink key="five" href="/engage-with-us" onClick={onClick}>
<NavigationLink key="four" href="/engage-with-us" onClick={onClick}>
Engage with us
</NavigationLink>,
];
Expand Down
11 changes: 11 additions & 0 deletions src/app/components/Header/Header.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@media (min-width: 1024px) {
.navbarLogoText {
font-size: 22px;
}
}

@media (max-width: 1024px) {
.navbarLogoText {
font-size: 13px;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import { Header as USWDSHeader, PrimaryNav } from '@trussworks/react-uswds';
import Image from 'next/image';
import React from 'react';
import styles from '../styles/Home.module.scss';
import classNames from 'classnames';
import { basePath } from '../utils/constants';
import { NavigationLink } from './NavigationLink';
import { basePath } from '../../utils/constants';
import { NavigationLink } from '../NavigationLink/NavigationLink';
import styles from './Header.module.scss';

export default function Header() {
const [expanded, setExpanded] = React.useState(false);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GridContainer } from '@trussworks/react-uswds';
import styles from '../styles/Hero.module.scss';
import styles from './Hero.module.scss';

interface HeroProps {
header: string;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactMarkdown from 'react-markdown';
import { getMarkdownContent } from '../utils/markdown';
import { getMarkdownContent } from '../../utils/markdown';

export default async function MarkdownContent(fileName: string) {
const markdownContent = await getMarkdownContent(fileName);
Expand Down
11 changes: 11 additions & 0 deletions src/app/components/NavigationLink/NavigationLink.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@media (min-width: 1024px) {
.navbarItemText {
color: #f0f0f0;
}
}

@media (max-width: 1024px) {
.navbarItemText {
color: #565c65;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import classNames from 'classnames';
import Link, { LinkProps } from 'next/link';
import { usePathname } from 'next/navigation';
import styles from '../styles/Home.module.scss';
import styles from './NavigationLink.module.scss';

interface NavigationLinkProps extends Pick<LinkProps, 'href' | 'onClick'> {
children: React.ReactNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
MediaBlockBody,
Icon,
} from '@trussworks/react-uswds';
import { basePath } from '../utils/constants';
import { basePath } from '../../utils/constants';

export default function USABanner() {
const [isOpen, setIsOpen] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/app/engage-with-us/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Hero from '../components/Hero';
import Hero from '../components/Hero/Hero';

export default function EngageWithUs() {
return (
Expand Down
6 changes: 3 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from 'next';
import Header from './components/Header';
import Footer from './components/Footer';
import USABanner from './components/UsaBanner';
import Header from './components/Header/Header';
import Footer from './components/Footer/Footer';
import USABanner from './components/UsaBanner/UsaBanner';
import { basePath } from './utils/constants';
import './globals.scss';
import './custom-styles.css';
Expand Down
6 changes: 3 additions & 3 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import MarkdownContent from './components/MarkdownComponent';
import MarkdownContent from './components/MarkdownComponent/MarkdownComponent';
import { Grid } from '@trussworks/react-uswds';
import Image from 'next/image';
import { basePath } from './utils/constants';
import Hero from './components/Hero';
import InvitationCta from './components/InvitationCta';
import Hero from './components/Hero/Hero';
import InvitationCta from './components/InvitationCta/InvitationCta';

export default async function Home() {
return (
Expand Down
Loading

0 comments on commit 9780828

Please sign in to comment.