Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .babelrc

This file was deleted.

5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
semi: true,
singleQuote: true,
trailingComma: 'all',
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ The section that you need to create is shown in **agencyselection.png**

1. The main Section must be placed in the folder sections.
2. All collections of components must be created and placed in the collections folder. (for example such things are Forms, Menus, etc. because they contain multiple other components within themselves, a form contains inputs, checkboxes, radio buttons, buttons and so on, that is making it a _collection of components_)
3. All base components that are making up collections of components go to components folder - these are Typography, Buttons, Checkboxes and other base elements.
3. All base components that are making up collections of components go to components folder - these are Typography, Buttons, Checkboxes and other base elements.

You will find the desktop and mobile designs in the resources folder.
That folder is not part of the project, its there for your convenience
Expand Down
1 change: 0 additions & 1 deletion collections/Card/Card.jsx

This file was deleted.

33 changes: 33 additions & 0 deletions collections/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { FC } from 'react';
import Image from 'next/image';
import {
CardContainer,
CardInfoContainer,
CardInnerHeading,
CardInnerText,
ImageContainer,
} from './elements';
import { CardProps } from '../../types/types';

export const Card: FC<{ card: CardProps }> = ({ card }) => {
const { image, title, description } = card;
const boldedDescription = description.replace(/<b>(.*?)<\/b>/g, '<b>$1</b>');
return (
<CardContainer>
<ImageContainer>
<Image
src={image.src}
alt={title}
width={image.width}
height={image.height}
/>
</ImageContainer>
<CardInfoContainer>
<CardInnerHeading>{card.title}</CardInnerHeading>
<CardInnerText
dangerouslySetInnerHTML={{ __html: boldedDescription }}
/>
</CardInfoContainer>
</CardContainer>
);
};
1 change: 0 additions & 1 deletion collections/Card/elements.jsx

This file was deleted.

70 changes: 70 additions & 0 deletions collections/Card/elements.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { HTMLAttributes } from 'react';
import styled from 'styled-components';

export const CardContainer = styled((props: HTMLAttributes<HTMLDivElement>) => (
<div {...props} />
))`
display: flex;
align-items: center;
width: 100%;
min-height: 7rem;
border-radius: 10px;
border: 3px solid transparent;

&:hover {
border: 3px solid #006efd;
color: #006efd;
cursor: pointer;
}
`;

export const CardInnerHeading = styled(
(props: HTMLAttributes<HTMLHeadingElement>) => <h1 {...props} />,
)`
font-family: Poppins;
font-weight: 700;
font-size: 1.2rem;
margin-bottom: 0;

${CardContainer}:hover & {
text-decoration: underline;
}
`;

export const CardInnerText = styled(
(props: HTMLAttributes<HTMLParagraphElement>) => <p {...props} />,
)`
font-family: Poppins;
font-size: 1rem;
line-height: 1.5rem;
font-weight: 400;
color: black;
margin-top: 5px;

b {
font-weight: bold;
}
`;

export const CardInfoContainer = styled(
(props: HTMLAttributes<HTMLDivElement>) => <div {...props} />,
)`
display: flex;
flex-grow: 1;
flex-direction: column;
justify-content: center;
padding-right: 20px;
`;

export const ImageContainer = styled(
(props: HTMLAttributes<HTMLDivElement>) => <div {...props} />,
)`
display: flex;
max-width: 5rem;
max-height: 5rem;
width: 75%;
height: 75%;
justify-content: center;
align-self: center;
padding: 2rem;
`;
1 change: 0 additions & 1 deletion collections/Card/index.js

This file was deleted.

1 change: 1 addition & 0 deletions collections/Card/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Card';
1 change: 0 additions & 1 deletion collections/index.js

This file was deleted.

1 change: 1 addition & 0 deletions collections/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Card';
9 changes: 0 additions & 9 deletions components/Button/Button.jsx

This file was deleted.

14 changes: 14 additions & 0 deletions components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { ButtonHTMLAttributes, ReactNode, FC } from 'react';
import { StyledButton, StyledButtonText } from './elements';

interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
children: ReactNode;
props: any;
}
export const Button: FC<ButtonProps> = ({ children, ...props }) => {
return (
<StyledButton {...(props as any)}>
<StyledButtonText>{children}</StyledButtonText>
</StyledButton>
);
};
67 changes: 0 additions & 67 deletions components/Button/elements.jsx

This file was deleted.

77 changes: 77 additions & 0 deletions components/Button/elements.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import styled, { css } from 'styled-components';
import { SectionInnerHeading } from '../Typography/SectionInnerHeading';
import { ButtonHTMLAttributes } from 'react';
import { theme } from '../../styles';

export interface StyledButtonProps
extends ButtonHTMLAttributes<HTMLButtonElement> {
color?: keyof typeof theme;
variant?: 'outlined' | 'contained' | 'text';
}

const outlinedVariantButton = css<StyledButtonProps>`
background-color: transparent;
border: 1px solid;
border-color: ${({ theme, color = 'main' }) => theme[color]};
color: ${({ theme, color = 'main' }) => theme[color]};

&:hover {
border-color: ${({ theme }) => theme.main};
background-color: ${({ theme }) => theme.main};
color: ${({ theme }) => theme.white};
}
`;

const containedVariantButton = css<StyledButtonProps>`
background-color: ${({ theme, color = 'main' }) => theme[color]};

&:hover {
background-color: ${({ theme, color = 'main' }) => theme.hover[color]};
}
`;

const textVariantButton = css<StyledButtonProps>`
background-color: transparent;
border: none;
border-radius: 0;
min-width: unset;
padding: 0 2rem;
margin: 0 2rem;
color: ${({ theme, color = 'main' }) => theme[color]};

&:hover {
color: ${({ theme }) => theme.black};
border-bottom: 1px solid ${({ theme }) => theme.black};
}
`;

const buttonVariants = {
outlined: outlinedVariantButton,
contained: containedVariantButton,
text: textVariantButton,
};

export const StyledButton = styled.button<StyledButtonProps>`
font-family: sans-serif;
overflow: hidden;
text-align: center;
align-self: center;
display: flex;
align-items: center;
justify-content: center;
border-radius: 7px;
font-weight: 500;
font-size: 16px;
line-height: 24px;
min-width: 184px;
min-height: 56px;
padding: 16px 0;
cursor: pointer;
border: none;
color: white;
${({ variant = 'contained' }) => buttonVariants[variant]}
`;

export const StyledButtonText = styled((props) => (
<SectionInnerHeading {...props} />
))``;
1 change: 0 additions & 1 deletion components/Button/index.js

This file was deleted.

1 change: 1 addition & 0 deletions components/Button/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Button';
5 changes: 0 additions & 5 deletions components/Containers/SectionContainer/SectionContainer.jsx

This file was deleted.

8 changes: 8 additions & 0 deletions components/Containers/SectionContainer/SectionContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { FC, HTMLAttributes } from 'react';
import { StyledSectionContainer } from './elements';

interface SectionContainerProps extends HTMLAttributes<HTMLDivElement> {}

export const SectionContainer: FC<SectionContainerProps> = ({ ...props }) => {
return <StyledSectionContainer {...props} />;
};
12 changes: 0 additions & 12 deletions components/Containers/SectionContainer/elements.jsx

This file was deleted.

18 changes: 18 additions & 0 deletions components/Containers/SectionContainer/elements.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { HTMLAttributes } from 'react';
import styled from 'styled-components';

interface StyledSectionContainerProps extends HTMLAttributes<HTMLDivElement> {
topMargin?: number;
bottomMargin?: number;
}

export const StyledSectionContainer = styled.div<StyledSectionContainerProps>`
display: flex;
max-width: 1920px;
width: 100%;
height: auto;
margin-left: auto;
margin-right: auto;
margin-top: ${({ topMargin }) => topMargin}rem;
margin-bottom: ${({ bottomMargin }) => bottomMargin}rem;
`;
1 change: 0 additions & 1 deletion components/Containers/SectionContainer/index.js

This file was deleted.

1 change: 1 addition & 0 deletions components/Containers/SectionContainer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './SectionContainer';
1 change: 0 additions & 1 deletion components/Containers/index.js

This file was deleted.

1 change: 1 addition & 0 deletions components/Containers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './SectionContainer';
5 changes: 0 additions & 5 deletions components/Typography/SectionBigHeading.jsx

This file was deleted.

Loading