-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #472 from sirraminyavari/dev-redesign
feat: ✨ update `Template Settings` view navigation and bread…
- Loading branch information
Showing
7 changed files
with
96 additions
and
20 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
88 changes: 88 additions & 0 deletions
88
src/views/Templates/TemplateSinglePage/TemplateSinglePageTopMenu.jsx
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,88 @@ | ||
import { RVVariantProp, Typography } from '@cliqmind/rv-components'; | ||
import Button from 'components/Buttons/Button'; | ||
import { decodeBase64 } from 'helpers/helpers'; | ||
import { useHistory } from 'react-router-dom'; | ||
import styled from 'styled-components'; | ||
import { useTemplateContext } from './TemplateProvider'; | ||
|
||
const TemplateSinglePageTopMenu = ({ templatePath }) => { | ||
const history = useHistory(); | ||
const { Title, NodeTypeID } = useTemplateContext(); | ||
const gotoPath = (path) => () => history.push(path); | ||
return ( | ||
<Container> | ||
<Typography type="H3">{decodeBase64(Title)}</Typography> | ||
<NavContainer> | ||
<NavButton | ||
active={history.location.pathname.endsWith('/basic')} | ||
onClick={gotoPath(`${templatePath.replace(':id', NodeTypeID)}/basic`)} | ||
> | ||
General | ||
</NavButton> | ||
<NavButton | ||
active={history.location.pathname.endsWith('/forms')} | ||
onClick={gotoPath(`${templatePath.replace(':id', NodeTypeID)}/forms`)} | ||
> | ||
Form builder | ||
</NavButton> | ||
<NavButton | ||
active={history.location.pathname.endsWith('/advanced')} | ||
onClick={gotoPath( | ||
`${templatePath.replace(':id', NodeTypeID)}/advanced` | ||
)} | ||
> | ||
Advanced | ||
</NavButton> | ||
<NavButton | ||
active={history.location.pathname.endsWith('/items')} | ||
onClick={gotoPath(`${templatePath.replace(':id', NodeTypeID)}/items`)} | ||
> | ||
Items | ||
</NavButton> | ||
</NavContainer> | ||
<Button | ||
variant={RVVariantProp.white} | ||
onClick={gotoPath(`${templatePath.replace(':id', '')}`)} | ||
> | ||
Back to templates | ||
</Button> | ||
</Container> | ||
); | ||
}; | ||
TemplateSinglePageTopMenu.displayName = 'TemplateSinglePageTopMenu'; | ||
export default TemplateSinglePageTopMenu; | ||
|
||
const Container = styled.div` | ||
padding-inline: 2rem; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: 1rem; | ||
flex-wrap: wrap; | ||
`; | ||
const NavContainer = styled.div` | ||
padding-inline: 2rem; | ||
display: flex; | ||
gap: 0.5rem; | ||
justify-content: space-between; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
`; | ||
const NavButton = styled(Button).attrs({ variant: RVVariantProp.white })` | ||
box-shadow: none !important; | ||
background-color: transparent !important; | ||
position: relative; | ||
color: ${({ active }) => (active ? 'hsl(var(--base))' : '')}; | ||
::after { | ||
content: ''; | ||
position: absolute; | ||
bottom: 0; | ||
right: 0; | ||
width: 100%; | ||
height: 0.25rem; | ||
background: ${({ active }) => | ||
active ? 'hsl(var(--base))' : 'transparent'}; | ||
border-start-start-radius: 1rem; | ||
border-start-end-radius: 1rem; | ||
} | ||
`; |
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