-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
banner, text size, link in card, stepper
- Loading branch information
Пётр Безденежных
authored and
Пётр Безденежных
committed
Mar 8, 2024
1 parent
a7b95fd
commit 5126649
Showing
10 changed files
with
113 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { memo } from "react"; | ||
import Gallery from "./gallery"; | ||
import Stepper from "./stepper" | ||
|
||
export default memo(function Banner(props: any) { | ||
const { type, ...data } = props; | ||
return(<> | ||
{ type === 'gallery' ? < Gallery {...data} /> : null } | ||
{ type === 'stepper' ? < Stepper {...data} /> : null } | ||
</>); | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
import { Flex, | ||
Text, | ||
Box, | ||
useMediaQuery, | ||
Step, | ||
StepDescription, | ||
StepIcon, | ||
StepIndicator, | ||
StepNumber, | ||
StepSeparator, | ||
StepStatus, | ||
StepTitle, | ||
Stepper, | ||
useSteps | ||
} from '@chakra-ui/react' | ||
import { memo } from "react" | ||
|
||
export default memo(function Gallery(props: any) { | ||
const { steps, active } = props; | ||
const [isMax1100] = useMediaQuery('(max-width: 1100px)'); | ||
const { activeStep } = useSteps({ | ||
index: active, | ||
count: steps.length, | ||
}); | ||
return ( | ||
<Stepper index={active} colorScheme='red' height='100px' gap='0'> | ||
{steps.map((step: {title: string; description: string;}, index:number) => ( | ||
<Step key={index}> | ||
<StepIndicator> | ||
<StepStatus | ||
complete={<StepNumber />} | ||
incomplete={<StepNumber />} | ||
active={<StepNumber />} | ||
/> | ||
</StepIndicator> | ||
|
||
<Box flexShrink='0'> | ||
<StepTitle>{step.title}</StepTitle> | ||
<StepDescription>{step.description}</StepDescription> | ||
</Box> | ||
|
||
<StepSeparator /> | ||
</Step> | ||
))} | ||
</Stepper> | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters