-
Notifications
You must be signed in to change notification settings - Fork 62
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 #358 from l3vels/fix/ui-changes
Fix/UI changes
- Loading branch information
Showing
33 changed files
with
352 additions
and
165 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,16 @@ | ||
import { ButtonTertiary } from 'components/Button/Button' | ||
|
||
import Play from '@l3-lib/ui-core/dist/icons/PlayOutline' | ||
import Typography from '@l3-lib/ui-core/dist/Typography' | ||
import Button from '@l3-lib/ui-core/dist/Button' | ||
|
||
const DemoButton = ({ onClick }: { onClick: () => void }) => { | ||
return ( | ||
<ButtonTertiary onClick={onClick} size={Button.sizes.SMALL}> | ||
<Play size={18} color={'#E332E6'} /> | ||
<Typography customColor={'#E332E6'} value={'Demo'} size={Button.sizes.SMALL} /> | ||
</ButtonTertiary> | ||
) | ||
} | ||
|
||
export default DemoButton |
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 @@ | ||
export { default } from './DemoButton' |
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,68 @@ | ||
import withRenderModal from 'hocs/withRenderModal' | ||
|
||
import Modal from '@l3-lib/ui-core/dist/Modal' | ||
|
||
import IconButton from '@l3-lib/ui-core/dist/IconButton' | ||
import Close from '@l3-lib/ui-core/dist/icons/Close' | ||
|
||
import { useModal } from 'hooks' | ||
import styled from 'styled-components' | ||
import { StyledButtonWrapper } from './AgentViewModal' | ||
|
||
type VideoModalProps = { | ||
data: { | ||
videoSrc: string | ||
} | ||
} | ||
|
||
const VideoModal = ({ data }: VideoModalProps) => { | ||
const { closeModal } = useModal() | ||
|
||
const { videoSrc } = data | ||
|
||
return ( | ||
<StyledModal | ||
onClose={() => closeModal('video-modal')} | ||
show | ||
backgroundColor='dark' | ||
hideCloseButton | ||
> | ||
<StyledModalBody> | ||
<StyledIframe | ||
width='900' | ||
height='600' | ||
src={`https://www.youtube.com/embed/${videoSrc}`} | ||
title='YouTube video player' | ||
frameBorder='0' | ||
allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' | ||
allowFullScreen | ||
></StyledIframe> | ||
</StyledModalBody> | ||
|
||
<StyledButtonWrapper> | ||
<IconButton | ||
size={IconButton.sizes.XS} | ||
icon={() => <Close />} | ||
kind={IconButton.kinds.TERTIARY} | ||
onClick={() => closeModal('video-modal')} | ||
/> | ||
</StyledButtonWrapper> | ||
</StyledModal> | ||
) | ||
} | ||
|
||
export default withRenderModal('video-modal')(VideoModal) | ||
|
||
const StyledModalBody = styled.div` | ||
padding-top: 10px; | ||
` | ||
|
||
const StyledModal = styled(Modal)` | ||
.components-Modal-Modal-module__overlay--OO00T { | ||
backdrop-filter: unset; | ||
} | ||
` | ||
const StyledIframe = styled.iframe` | ||
border-radius: 10px; | ||
margin: auto; | ||
` |
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
19 changes: 19 additions & 0 deletions
19
apps/ui/src/pages/Agents/AgentForm/components/AgentDemoButton.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 DemoButton from 'components/DemoButton' | ||
import { useModal } from 'hooks' | ||
|
||
const AgentDemoButton = () => { | ||
const { openModal } = useModal() | ||
|
||
return ( | ||
<DemoButton | ||
onClick={() => | ||
openModal({ | ||
name: 'video-modal', | ||
data: { videoSrc: import.meta.env.REACT_APP_YOUTUBE_VIDEO_ID }, | ||
}) | ||
} | ||
/> | ||
) | ||
} | ||
|
||
export default AgentDemoButton |
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.