-
Notifications
You must be signed in to change notification settings - Fork 33
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
110 changed files
with
570 additions
and
513 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
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
29 changes: 29 additions & 0 deletions
29
front/app/components/admin/ContentBuilder/EditModePreview/ViewButtons/DesktopButton.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,29 @@ | ||
import React from 'react'; | ||
|
||
// components | ||
import ViewButton from './ViewButton'; | ||
import { Icon, colors } from '@citizenlab/cl2-component-library'; | ||
|
||
interface Props { | ||
active: boolean; | ||
onClick: () => void; | ||
} | ||
|
||
const DesktopButton = ({ active, onClick }: Props) => { | ||
return ( | ||
<ViewButton | ||
id="e2e-desktop-preview" | ||
borderRadius="0px 4px 4px 0px" | ||
active={active} | ||
onClick={onClick} | ||
> | ||
<Icon | ||
name="desktop" | ||
width="20px" | ||
fill={active ? colors.white : colors.primary} | ||
/> | ||
</ViewButton> | ||
); | ||
}; | ||
|
||
export default DesktopButton; |
30 changes: 30 additions & 0 deletions
30
front/app/components/admin/ContentBuilder/EditModePreview/ViewButtons/MobileButton.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,30 @@ | ||
import React from 'react'; | ||
|
||
// components | ||
import ViewButton from './ViewButton'; | ||
import { Icon, colors } from '@citizenlab/cl2-component-library'; | ||
|
||
interface Props { | ||
active: boolean; | ||
onClick: () => void; | ||
} | ||
|
||
const MobileButton = ({ active, onClick }: Props) => { | ||
return ( | ||
<ViewButton | ||
id="e2e-mobile-preview" | ||
borderRadius="4px 0px 0px 4px" | ||
active={active} | ||
onClick={onClick} | ||
> | ||
<Icon | ||
name="tablet" | ||
width="16px" | ||
height="20px" | ||
fill={active ? colors.white : colors.primary} | ||
/> | ||
</ViewButton> | ||
); | ||
}; | ||
|
||
export default MobileButton; |
33 changes: 33 additions & 0 deletions
33
front/app/components/admin/ContentBuilder/EditModePreview/ViewButtons/ViewButton.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,33 @@ | ||
import React from 'react'; | ||
|
||
// components | ||
import { Button, colors } from '@citizenlab/cl2-component-library'; | ||
|
||
interface Props { | ||
children: React.ReactNode; | ||
id?: string; | ||
borderRadius: string; | ||
active: boolean; | ||
onClick: () => void; | ||
} | ||
|
||
const ViewButton = ({ children, id, borderRadius, active, onClick }: Props) => { | ||
return ( | ||
<Button | ||
id={id} | ||
bgColor={active ? colors.primary : colors.white} | ||
onClick={() => { | ||
!active && onClick(); | ||
}} | ||
borderRadius={borderRadius} | ||
bgHoverColor={active ? colors.primary : colors.white} | ||
borderColor={colors.primary} | ||
height="40px" | ||
width="92px" | ||
> | ||
{children} | ||
</Button> | ||
); | ||
}; | ||
|
||
export default ViewButton; |
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
Oops, something went wrong.