Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
feat: Built stepper form
Browse files Browse the repository at this point in the history
  • Loading branch information
CHR-onicles committed Nov 3, 2023
1 parent dcf477b commit a0aab6d
Show file tree
Hide file tree
Showing 26 changed files with 465 additions and 631 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Animated Stepper Form

An animated stepper form built with React + TS
Experimenting with an animated carousel built with a carousel library.

 

![Animated form](assets/animated-form.png)
Binary file added assets/animated-form.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Google font -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet" />
<title>Animated stepper form</title>
</head>
<body>
Expand Down
50 changes: 25 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"react-datepicker": "^4.21.0",
"react-dom": "^18.2.0",
"react-icons": "^4.11.0",
"react-router-dom": "^6.17.0",
"react-router-dom": "^6.18.0",
"react-use": "^17.4.0",
"styled-components": "^6.1.0"
},
Expand Down
13 changes: 13 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
import { RouterProvider } from "react-router-dom";
import { useWindowSize } from "react-use";

import { SmallScreenIndicator } from "@components/SmallScreenIndicator";

import { GlobalStyles } from "@styles/GlobalStyles.styled";

import { router } from "./router";


export const App = () => {
const { width } = useWindowSize();

if (width < 768) {
return (
<>
<GlobalStyles />
<SmallScreenIndicator />
</>
);
}
return (
<>
<GlobalStyles />
Expand Down
Binary file removed src/assets/black-panther.webp
Binary file not shown.
3 changes: 3 additions & 0 deletions src/assets/icons/rotate-phone.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/misc/logo-procrea-half.png
Binary file not shown.
Binary file removed src/assets/misc/logo-procrea.png
Binary file not shown.
Binary file added src/assets/misc/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions src/components/Button/Button.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ import { rem } from "@styles/Utilities.styled";
export const StyledPrimaryButton = styled.button`
padding: 0.5em 1.5em;
color: var(--clr-white);
background-color: var(--clr-accent);
background-color: var(--clr-primary-400);
font-size: ${rem(15)};
font-weight: 500;
border-radius: var(--border-radius-3);
transition: background-color 0.2s;
&:hover:not(:disabled),
&:focus:not(:disabled) {
background-color: hsl(180, 96%, 35%);
background-color: color-mix(
in srgb,
var(--clr-primary-400) 80%,
rgb(255, 255, 255)
);
}
&:disabled {
Expand Down
8 changes: 1 addition & 7 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@ import { StyledPrimaryButton } from "./Button.styled";


interface ButtonProps {
className?: string;
children: React.ReactNode;
}

export const PrimaryButton = ({
children,
className,
...rest
}: ButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => {
return (
<StyledPrimaryButton className={className} {...rest}>
{children}
</StyledPrimaryButton>
);
return <StyledPrimaryButton {...rest}>{children}</StyledPrimaryButton>;
};
3 changes: 3 additions & 0 deletions src/components/CustomDatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface CustomDatePickerProps {
placeholder?: string;
minDate?: Date;
showYearDropdown?: boolean;
required?: boolean;
}

export const CustomDatePicker = ({
Expand All @@ -35,6 +36,7 @@ export const CustomDatePicker = ({
placeholder,
minDate = new Date(1900, 0, 1),
showYearDropdown = false,
required = false,
}: CustomDatePickerProps) => {
// console.log("[From Date picker]", startDate);

Expand All @@ -48,6 +50,7 @@ export const CustomDatePicker = ({
{isInline ? null : <BsCalendar className="calendar-icon" />}
<DatePicker
locale={enGB}
required={required}
selected={startDate}
onChange={date => {
setStartDate(date!);
Expand Down
99 changes: 0 additions & 99 deletions src/components/Dropdown/Dropdown.styled.ts

This file was deleted.

Loading

0 comments on commit a0aab6d

Please sign in to comment.