Skip to content

Commit

Permalink
- added title
Browse files Browse the repository at this point in the history
- added body
- added section base
  • Loading branch information
souljja committed Mar 12, 2024
1 parent a00fed4 commit fc93e1a
Show file tree
Hide file tree
Showing 40 changed files with 343 additions and 473 deletions.
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@
"no-void": "off",
"no-continue": "off",
"no-unused-vars": "off",
"no-case-declarations": "off",
"no-restricted-imports": [
"error",
{
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
"@graphql-codegen/client-preset": "^4.2.4",
"@graphql-typed-document-node/core": "^3.2.0",
"@types/graphql": "^14.5.0",
"@types/node": "^20.11.25",
"@types/react": "^18.2.64",
"@types/node": "^20.11.26",
"@types/react": "^18.2.65",
"@types/react-dom": "^18.2.21",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react": "^4.2.1",
"dotenv-cli": "^7.4.1",
"eslint": "^8.57.0",
Expand All @@ -51,8 +51,8 @@
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"sass": "^1.71.1",
"typescript": "^5.4.2",
"vite": "^5.1.5",
"typescript": "^5.4.0",
"vite": "^5.1.6",
"vite-plugin-svgr": "^4.2.0"
}
}
9 changes: 4 additions & 5 deletions src/components/action-link/action-link.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
@use "@/styles/responsive-mixins";
@use "@/styles/mixins";

.action-link {
--_action-color: var(--action-color, var(--primary));
@include mixins.h5;
font-weight: 700;
position: relative;
display: inline-flex;
align-items: center;
font-family: Lato, sans-serif;
font-size: 1rem;
font-weight: 700;
line-height: 1.5;
color: var(--_action-color);
text-decoration: none;
width: fit-content;
Expand Down Expand Up @@ -42,6 +41,6 @@
}

@include responsive-mixins.lg {
font-size: 1.25rem;
@include mixins.h4;
}
}
6 changes: 4 additions & 2 deletions src/components/error-boundary/error-boundary.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Component, ErrorInfo, ReactNode } from "react";
import { Typography } from "@/components/text/typography.tsx";
import { Title } from "@/components/title/title.tsx";

interface Props {
children?: ReactNode;
Expand Down Expand Up @@ -33,8 +35,8 @@ export class ErrorBoundary extends Component<Props, State> {
return (
// TODO: Ask designer about component
<section>
<h1>Oops, something went wrong</h1>
<p>There are some issues while loading the page</p>
<Title as="h1">Oops, something went wrong</Title>
<Typography>There are some issues while loading the page</Typography>
</section>
);
}
Expand Down
5 changes: 2 additions & 3 deletions src/components/footer/footer.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use "@/styles/responsive-mixins";
@use "@/styles/mixins";

.footer {
display: flex;
Expand Down Expand Up @@ -26,9 +27,8 @@
}

.social-title {
font-size: 1.25rem;
@include mixins.h4;
font-weight: 600;
line-height: 1.5;
}

.social-links {
Expand All @@ -52,7 +52,6 @@
font-family: "Open Sans", sans-serif;
font-size: 0.75rem;
font-weight: 600;
line-height: 1.5;
gap: 12px;
}

Expand Down
7 changes: 6 additions & 1 deletion src/components/footer/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Link } from "react-router-dom";
import { Title } from "@/components/title/title.tsx";
import {
ComponentSharedSocialIcon,
PageEntity,
Expand All @@ -19,7 +20,11 @@ export const Footer = ({ socialLinks, heading, navigation }: FooterProps) => {
<footer className="footer">
{socialLinks && (
<div className="social-info">
{heading && <h3 className="social-title">{heading}</h3>}
{heading && (
<Title as="h3" className="social-title">
{heading}
</Title>
)}
<div className="social-links">
{socialLinks.map(({ title, newTab, url, icon }) => {
const iconData = icon?.data?.attributes;
Expand Down
16 changes: 3 additions & 13 deletions src/components/image-banner/image-banner.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use "@/styles/responsive-mixins";
@use "@/styles/mixins";

.image-banner {
position: relative;
Expand Down Expand Up @@ -33,17 +34,10 @@
}

&-title {
font-family: Lato, sans-serif;
font-size: 1.25rem;
font-weight: 500;
line-height: 1.5;
@include mixins.h4;
}

&-body {
font-family: "Open Sans", sans-serif;
font-size: 0.875rem;
font-weight: 400;
line-height: 1.5;
margin-top: 8px;
}

Expand Down Expand Up @@ -75,11 +69,7 @@
}

&-title {
font-size: 1.5rem;
}

&-body {
font-size: 1rem;
@include mixins.h3;
}
}
}
6 changes: 4 additions & 2 deletions src/components/image-banner/image-banner.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ActionLink } from "@/components/action-link/action-link.tsx";
import { Typography } from "@/components/text/typography.tsx";
import { Title } from "@/components/title/title.tsx";
import "./image-banner.scss";

export interface ImageBannerProps {
Expand Down Expand Up @@ -26,8 +28,8 @@ export const ImageBanner = ({
</div>
<div className="image-banner-content">
<div className="image-banner-card">
<h2 className="image-banner-title">{title}</h2>
<p className="image-banner-body">{body}</p>
<Title className="image-banner-title">{title}</Title>
<Typography className="image-banner-body">{body}</Typography>
<ActionLink href="/" className="image-banner-action">
{action}
</ActionLink>
Expand Down
21 changes: 4 additions & 17 deletions src/components/information-card/information-card.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use "@/styles/responsive-mixins";
@use "@/styles/mixins";

.information-card {
padding: 24px;
Expand All @@ -18,17 +19,7 @@
}

&-title {
font-family: Lato, sans-serif;
font-size: 1.25rem;
font-weight: 400;
line-height: 1.5;
}

&-body {
font-family: "Open Sans", sans-serif;
font-size: 0.875rem;
font-weight: 300;
line-height: 1.2;
@include mixins.h4;
}

&-image-wrapper {
Expand All @@ -46,7 +37,7 @@

&-title {
text-align: center;
font-size: 1rem;
@include mixins.h5;
}

&-image-wrapper {
Expand All @@ -72,11 +63,7 @@
}

&-title {
font-size: 1.5rem;
}

&-body {
font-size: 1rem;
@include mixins.h3;
}

&-image-wrapper {
Expand Down
8 changes: 6 additions & 2 deletions src/components/information-card/information-card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Button } from "@/components/button/button.tsx";
import { Typography } from "@/components/text/typography.tsx";
import { Title } from "@/components/title/title.tsx";
import "./information-card.scss";

export interface DescriptionCardProps {
Expand All @@ -19,8 +21,10 @@ export const InformationCard = ({
<img className="" src={image} role="presentation" alt="" />
</div>
<div className="information-card-info">
<span className="information-card-title">{title}</span>
<p className="information-card-body">{body}</p>
<Title as="h4" className="information-card-title">
{title}
</Title>
<Typography className="information-card-body">{body}</Typography>
</div>
{action && (
<Button className="information-card-action" variant="outline">
Expand Down
31 changes: 5 additions & 26 deletions src/components/news-card/news-card.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use "@/styles/responsive-mixins";
@use "@/styles/mixins";

.news-card {
--_text-color: var(--text-color, var(--black));
Expand Down Expand Up @@ -44,26 +45,17 @@

&-title {
flex-shrink: 0;
font-family: Lato, sans-serif;
font-size: 1rem;
font-weight: 500;
line-height: 1.5;
@include mixins.h5;
}

&-body {
flex-grow: 1;
font-family: "Open Sans", sans-serif;
font-size: 0.875rem;
font-weight: 400;
line-height: 1.5;
}

&-action {
flex-shrink: 0;
font-family: Lato, sans-serif;
font-size: 1rem;
@include mixins.h5;
font-weight: 600;
line-height: 1.5;
flex-shrink: 0;
margin-top: 16px;
text-decoration: none;
color: var(--_action-color);
Expand All @@ -87,14 +79,6 @@
padding: 16px 24px 24px;
}

&-title {
font-weight: 600;
}

&-body {
font-size: 0.75rem;
}

&-action {
font-size: 0.875rem;
}
Expand All @@ -110,12 +94,7 @@
}

&-title {
font-weight: 500;
font-size: 1.25rem;
}

&-body {
font-size: 1rem;
@include mixins.h4;
}

&-action {
Expand Down
8 changes: 6 additions & 2 deletions src/components/news-card/news-card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ElementType, HTMLAttributes } from "react";
import { Typography } from "@/components/text/typography.tsx";
import { Title } from "@/components/title/title.tsx";
import "./news-card.scss";

export type NewsCardTheme = "primary" | "secondary";
Expand All @@ -25,8 +27,10 @@ export const NewsCard = ({
<img className="news-card-image" role="presentation" alt="" src={cover} />
</div>
<div className="news-card-content">
<span className="news-card-title">{title}</span>
<p className="news-card-body">{body}</p>
<Title as="h4" className="news-card-title">
{title}
</Title>
<Typography className="news-card-body">{body}</Typography>
<a href="/" className="news-card-action">
{action}
</a>
Expand Down
23 changes: 23 additions & 0 deletions src/components/section-base/section-base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@use "@/styles/responsive-mixins";
@use "@/styles/mixins";

.section-base {
padding: 56px 16px;

&-title {
@include mixins.partial-underline;
@include mixins.h4;
}

@include responsive-mixins.md {
padding: 56px 24px;
}

@include responsive-mixins.lg {
padding: 64px 0;

&-title {
@include mixins.h2;
}
}
}
30 changes: 30 additions & 0 deletions src/components/section-base/section-base.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ReactNode } from "react";
import cc from "classcat";
import { Title, TitleProps } from "@/components/title/title.tsx";
import "./section-base.scss";

export interface SectionBaseProps {
children: ReactNode;
className?: string;
}

const SectionBaseComponent = ({ children, className }: SectionBaseProps) => (
<section className={cc(["section-base", className])}>{children}</section>
);

SectionBaseComponent.Title = function ({
className,
children,
...delegatedProps
}: TitleProps) {
return (
<Title
{...delegatedProps}
className={cc(["section-base-title", className])}
>
{children}
</Title>
);
};

export const SectionBase = SectionBaseComponent;
Loading

0 comments on commit fc93e1a

Please sign in to comment.