Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
363 additions
and
200 deletions.
There are no files selected for viewing
16 changes: 2 additions & 14 deletions
16
...lder/src/admin/components/Table/Empty.tsx → ...rc/admin/components/Table/Empty/index.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
14 changes: 14 additions & 0 deletions
14
packages/app-page-builder/src/admin/components/Table/Empty/styled.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,14 @@ | ||
import styled from "@emotion/styled"; | ||
import { ReactComponent as Add } from "@material-design-icons/svg/filled/add.svg"; | ||
|
||
export const Buttons = styled("div")` | ||
> button { | ||
margin: 0 8px; | ||
} | ||
`; | ||
|
||
export const Icon = styled(Add)` | ||
fill: var(--mdc-theme-primary); | ||
width: 18px; | ||
margin-right: 8px; | ||
`; |
46 changes: 0 additions & 46 deletions
46
packages/app-page-builder/src/admin/components/Table/Header.tsx
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
packages/app-page-builder/src/admin/components/Table/Header/ButtonsCreate/index.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,34 @@ | ||
import React, { ReactElement } from "react"; | ||
|
||
import { i18n } from "@webiny/app/i18n"; | ||
import { ButtonIcon, ButtonPrimary, ButtonSecondary } from "@webiny/ui/Button"; | ||
import { ReactComponent as Add } from "@material-design-icons/svg/filled/add.svg"; | ||
|
||
import { Container } from "./styled"; | ||
|
||
const t = i18n.ns("app-page-builder/admin/views/pages/table/header/buttons/create"); | ||
|
||
interface Props { | ||
onCreatePage: (event?: React.SyntheticEvent) => void; | ||
onCreateFolder: (event?: React.SyntheticEvent) => void; | ||
} | ||
|
||
export const ButtonsCreate = ({ onCreateFolder, onCreatePage }: Props): ReactElement => { | ||
return ( | ||
<Container> | ||
<ButtonSecondary data-testid="new-folder-button" onClick={onCreateFolder} small={true}> | ||
<ButtonIcon icon={<Add />} /> | ||
{t`New Folder`} | ||
</ButtonSecondary> | ||
<ButtonPrimary | ||
data-testid="new-page-button" | ||
onClick={onCreatePage} | ||
flat={true} | ||
small={true} | ||
> | ||
<ButtonIcon icon={<Add />} /> | ||
{t`New Page`} | ||
</ButtonPrimary> | ||
</Container> | ||
); | ||
}; |
10 changes: 10 additions & 0 deletions
10
packages/app-page-builder/src/admin/components/Table/Header/ButtonsCreate/styled.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,10 @@ | ||
import styled from "@emotion/styled"; | ||
|
||
export const Container = styled("div")` | ||
display: flex; | ||
justify-content: flex-end; | ||
> button { | ||
margin-right: 8px; | ||
} | ||
`; |
15 changes: 15 additions & 0 deletions
15
packages/app-page-builder/src/admin/components/Table/Header/Title/index.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, { ReactElement } from "react"; | ||
import { Name } from "~/admin/components/Table/Header/Title/styled"; | ||
import { Skeleton } from "@webiny/ui/Skeleton"; | ||
|
||
interface Props { | ||
title?: string; | ||
} | ||
|
||
export const Title = ({ title }: Props): ReactElement => { | ||
return ( | ||
<Name use={"headline6"} tag={"h1"}> | ||
{title || <Skeleton />} | ||
</Name> | ||
); | ||
}; |
9 changes: 9 additions & 0 deletions
9
packages/app-page-builder/src/admin/components/Table/Header/Title/styled.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,9 @@ | ||
import styled from "@emotion/styled"; | ||
import { Typography, TypographyProps } from "@webiny/ui/Typography"; | ||
|
||
export const Name = styled(Typography)<TypographyProps>` | ||
padding-left: 16px; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
`; |
34 changes: 34 additions & 0 deletions
34
packages/app-page-builder/src/admin/components/Table/Header/index.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,34 @@ | ||
import React, { ReactElement } from "react"; | ||
import { Grid, Cell } from "@webiny/ui/Grid"; | ||
|
||
import { ButtonsCreate } from "~/admin/components/Table/Header/ButtonsCreate"; | ||
import { Title } from "~/admin/components/Table/Header/Title"; | ||
|
||
import { Container } from "./styled"; | ||
|
||
interface Props { | ||
title?: string; | ||
canCreate: boolean; | ||
onCreatePage: (event?: React.SyntheticEvent) => void; | ||
onCreateFolder: (event?: React.SyntheticEvent) => void; | ||
} | ||
|
||
export const Header = ({ canCreate, onCreatePage, onCreateFolder, title }: Props): ReactElement => { | ||
return ( | ||
<Container> | ||
<Grid align={"right"} style={{ padding: 0 }}> | ||
<Cell span={4}> | ||
<Title title={title} /> | ||
</Cell> | ||
{canCreate && ( | ||
<Cell span={8}> | ||
<ButtonsCreate | ||
onCreateFolder={onCreateFolder} | ||
onCreatePage={onCreatePage} | ||
/> | ||
</Cell> | ||
)} | ||
</Grid> | ||
</Container> | ||
); | ||
}; |
12 changes: 12 additions & 0 deletions
12
packages/app-page-builder/src/admin/components/Table/Header/styled.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,12 @@ | ||
import styled from "@emotion/styled"; | ||
|
||
export const Container = styled("div")` | ||
padding: 8px 0; | ||
width: 100%; | ||
background: var(--mdc-theme-surface); | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
z-index: 3; | ||
border-bottom: 1px solid rgba(0, 0, 0, 0.12); | ||
`; |
26 changes: 0 additions & 26 deletions
26
packages/app-page-builder/src/admin/components/Table/LoadingMore.tsx
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
packages/app-page-builder/src/admin/components/Table/LoadingMore/index.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 from "react"; | ||
import { i18n } from "@webiny/app/i18n"; | ||
import { Typography } from "@webiny/ui/Typography"; | ||
|
||
import { Container } from "./styled"; | ||
|
||
const t = i18n.ns("app-headless-cms/app-page-builder/pages-table/loading-more"); | ||
|
||
export const LoadingMore = () => { | ||
return ( | ||
<Container> | ||
<Typography use={"body2"}>{t`Loading more pages...`}</Typography> | ||
</Container> | ||
); | ||
}; |
13 changes: 13 additions & 0 deletions
13
packages/app-page-builder/src/admin/components/Table/LoadingMore/styled.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 styled from "@emotion/styled"; | ||
|
||
export const Container = styled("div")` | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100%; | ||
height: 40px; | ||
background-color: var(--mdc-theme-background); | ||
`; |
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
19 changes: 19 additions & 0 deletions
19
packages/app-page-builder/src/admin/components/Table/Preview/styled.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,19 @@ | ||
import styled from "@emotion/styled"; | ||
import { Drawer } from "@webiny/ui/Drawer"; | ||
|
||
export const Content = styled(Drawer)` | ||
width: 60vw; | ||
/** | ||
* Fixing list items display inside the drawer with dir="rtl" | ||
*/ | ||
.mdc-list-item__graphic { | ||
margin-left: 0 !important; | ||
margin-right: 32px !important; | ||
} | ||
.mdc-list-item__meta { | ||
margin-left: auto !important; | ||
margin-right: 0 !important; | ||
} | ||
`; |
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.