-
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.
- Loading branch information
Gerd Müller
committed
Jun 19, 2020
1 parent
649a18d
commit 4f2bd4d
Showing
8 changed files
with
106 additions
and
42 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
Empty file.
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,11 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
|
||
import Group from './group'; | ||
|
||
describe(' Group', () => { | ||
it('should render successfully', () => { | ||
const { baseElement } = render(<Group />); | ||
expect(baseElement).toBeTruthy(); | ||
}); | ||
}); |
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 React from 'react'; | ||
|
||
import './group.scss'; | ||
|
||
/* eslint-disable-next-line */ | ||
export interface GroupProps {} | ||
|
||
export const Group = (props: GroupProps) => { | ||
return ( | ||
<div> | ||
<h1>Welcome to group component!</h1> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Group; |
Empty file.
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,11 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
|
||
import Header from './header'; | ||
|
||
describe(' Header', () => { | ||
it('should render successfully', () => { | ||
const { baseElement } = render(<Header />); | ||
expect(baseElement).toBeTruthy(); | ||
}); | ||
}); |
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,49 @@ | ||
import React from 'react'; | ||
|
||
import Title from '../title/title'; | ||
import Scrollicon from '../scrollicon/scrollicon'; | ||
|
||
import { IMAGE_SUFFIX } from '@gerdesque/data'; | ||
|
||
import { makeStyles } from '@material-ui/core/styles'; | ||
import Chip from '@material-ui/core/Chip'; | ||
|
||
import './header.scss'; | ||
|
||
/* eslint-disable-next-line */ | ||
export interface HeaderProps { | ||
link: string | ||
name: string | ||
} | ||
|
||
export const Header = (props: HeaderProps) => { | ||
|
||
const [volume, setVolume] = React.useState(false); | ||
|
||
const audio = new Audio(`./assets/sounds/${props.link}.mp3`) | ||
const startAudio = () => { | ||
setVolume(!volume); | ||
volume ? audio.pause() : audio.play(); | ||
} | ||
|
||
const useStyles = makeStyles(() => ({ | ||
chapter: { | ||
backgroundImage: `url(${"./assets/"+ props.link+IMAGE_SUFFIX})`, | ||
boxShadow: '0 0 8px 8px #dcd5cc inset', | ||
flexDirection: 'column', | ||
}, | ||
})); | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<div className='parallax__group parallax__header'> | ||
<div className={`parallax__layer parallax__layer--base fade-in-scale ${classes.chapter}`}> | ||
<Title text={props.name} /> | ||
<Chip onClick={() => startAudio()} label={volume ? "Ton aus" : "Ton an"} /> | ||
<Scrollicon/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Header; |