-
-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add breadcrumb component * update breadcrumb * Various fixes * Improvement Co-authored-by: Thibault Lenclos <tlenclos@users.noreply.github.com> Co-authored-by: Baptiste Adrien <adrien.baptiste@gmail.com>
- Loading branch information
1 parent
6c0fe8b
commit 428c8fc
Showing
16 changed files
with
195 additions
and
140 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React, { FunctionComponent, ComponentClass } from 'react' | ||
import { useInteractive } from '../../hooks/useInteractive' | ||
import { Box } from '@chakra-ui/core' | ||
|
||
const PreviewContainer: React.FC<{ | ||
component: IComponent | ||
type: string | FunctionComponent<any> | ComponentClass<any, any> | ||
enableVisualHelper?: boolean | ||
isBoxWrapped?: boolean | ||
}> = ({ | ||
component, | ||
type, | ||
enableVisualHelper, | ||
isBoxWrapped, | ||
...forwardedProps | ||
}) => { | ||
const { props, ref } = useInteractive(component, enableVisualHelper) | ||
|
||
const children = React.createElement(type, { ...props, ...forwardedProps }) | ||
|
||
if (isBoxWrapped) { | ||
let boxProps: any = {} | ||
|
||
return ( | ||
<Box {...boxProps} ref={ref}> | ||
{children} | ||
</Box> | ||
) | ||
} | ||
|
||
return children | ||
} | ||
|
||
export default PreviewContainer |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
13 changes: 13 additions & 0 deletions
13
src/components/inspector/panels/components/BreadcrumbItemPanel.tsx
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,13 @@ | ||
import React, { memo } from 'react' | ||
|
||
import SwitchControl from '../../controls/SwitchControl' | ||
|
||
const BreadcrumbItemPanel = () => { | ||
return ( | ||
<> | ||
<SwitchControl label="Is current page" name="isCurrentPage" /> | ||
</> | ||
) | ||
} | ||
|
||
export default memo(BreadcrumbItemPanel) |
15 changes: 15 additions & 0 deletions
15
src/components/inspector/panels/components/BreadcrumbPanel.tsx
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,15 @@ | ||
import React, { memo } from 'react' | ||
import TextControl from '../../controls/TextControl' | ||
import SwitchControl from '../../controls/SwitchControl' | ||
|
||
const BreadcrumbPanel = () => { | ||
return ( | ||
<> | ||
<TextControl name="separator" label="Separator" /> | ||
<TextControl name="spacing" label="Spacing" /> | ||
<SwitchControl label="With separator" name="addSeparator" /> | ||
</> | ||
) | ||
} | ||
|
||
export default memo(BreadcrumbPanel) |
Oops, something went wrong.