-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [HER-155] Change from material to grid or box * [HER-155] Add feature flags in settings file * [HER-155] Use the flags for login * [HER-155] Use the flags for livestream * [HER-155] Move livestream component in a different file * [HER-155] Put the livestream component into a box * [HER-155] Put a different padding on livestream by feature value
- Loading branch information
1 parent
d85e94e
commit 15ea844
Showing
9 changed files
with
53 additions
and
19 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 |
---|---|---|
@@ -1,17 +1,16 @@ | ||
import React from 'react' | ||
import YouTube from 'react-youtube' | ||
import * as Material from '@material-ui/core' | ||
import { Box, Grid } from '@material-ui/core' | ||
|
||
import { Map } from 'cameras/map' | ||
import { settings } from 'settings' | ||
import { useStyles } from 'cameras/style' | ||
import { Livestream } from 'cameras/livestream' | ||
import { useLivestreamPadding } from 'cameras/hooks/use-livestream-padding' | ||
|
||
export const Content = () => <Material.Grid item xs={12} sm={11} md={9} lg={8}> | ||
<Material.Box pt={3} style={{ height: '80vh', width: '100%' }}> | ||
export const Content = () => <Grid xs={12} sm={11} md={9} lg={8}> | ||
<Box pt={3} style={{ height: '80vh', width: '100%' }}> | ||
<Map /> | ||
</Material.Box> | ||
<Material.Grid container justify={'center'} classes={useStyles()}> | ||
<YouTube videoId={settings().sources[0]} /> | ||
</Material.Grid> | ||
</Material.Grid> | ||
</Box> | ||
<Box pt={3} {...useLivestreamPadding()}> | ||
<Livestream /> | ||
</Box> | ||
</Grid> | ||
|
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,7 @@ | ||
import { useSettings } from 'settings/hooks/use-settings' | ||
|
||
export const useLivestreamPadding = () => { | ||
const appear = useSettings().features.livestream | ||
|
||
return appear ? { style: { paddingBottom: '2%' } } : { style: { paddingBottom: '3.8%' } } | ||
} |
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import React from 'react' | ||
import * as Material from '@material-ui/core' | ||
import { Grid } from '@material-ui/core' | ||
|
||
import { Content } from 'cameras/content' | ||
import { useDefaultContext, Context } from 'cameras/context' | ||
import { Sidebar } from 'cameras/sidebar' | ||
|
||
export const Cameras = () => <Context.Provider value={useDefaultContext()}> | ||
<Material.Grid container> | ||
<Grid container> | ||
<Sidebar /> | ||
<Content /> | ||
</Material.Grid> | ||
</Grid> | ||
</Context.Provider> | ||
|
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,7 @@ | ||
import { useStyles } from 'cameras/style' | ||
import { useSettings } from 'settings/hooks/use-settings' | ||
|
||
export const useLivestreamProps = () => ({ | ||
classes: useStyles(), | ||
hidden: !useSettings().features.livestream, | ||
}) |
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 React from 'react' | ||
import { Grid } from '@material-ui/core' | ||
import YouTube from 'react-youtube' | ||
|
||
import { settings } from 'settings' | ||
import { useLivestreamProps } from 'cameras/livestream/hooks/use-livestream-props' | ||
|
||
export const Livestream = () => <Grid {...useLivestreamProps()}> | ||
<YouTube videoId={settings().sources[0]} /> | ||
</Grid> |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import React from 'react' | ||
import * as Material from '@material-ui/core' | ||
import { Grid } from '@material-ui/core' | ||
|
||
import { Header } from 'cameras/sidebar/header' | ||
import { Ids } from 'cameras/sidebar/ids' | ||
|
||
export const Sidebar = () => <Material.Grid item xs={12} md={3}> | ||
export const Sidebar = () => <Grid item xs={12} md={3}> | ||
<Header /> | ||
<Ids /> | ||
</Material.Grid> | ||
</Grid> |
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,6 @@ | ||
import { useSettings } from 'settings/hooks/use-settings' | ||
|
||
export const useMenuProps = () => ({ | ||
px: 3, | ||
hidden: !useSettings().features.login, | ||
}) |
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