Skip to content

Commit

Permalink
Add a stopped prop to home component, so story can have a consistent vrt
Browse files Browse the repository at this point in the history
  • Loading branch information
SmileyJames committed Jun 27, 2021
1 parent de2d84c commit b530a3d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/src/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import NavBar from "components/navbar";
import TypedBanner from "components/typed-banner";
import CallToActionCard from "components/cta-card"

const Home = () => {
const Home = ({ stopped }) => {
const { push } = useHistory();
const [hideMenu, toggleMenu] = useReducer(o => !o, true)

Expand Down Expand Up @@ -40,7 +40,7 @@ const Home = () => {
<HostForm compendium={compendium} onNewGame={onNewGame} />
<JoinForm onJoinGame={onJoinGame} />
</Flex>
<TypedBanner typedSentences={typedSentences}/>
<TypedBanner stopped={stopped} typedSentences={typedSentences}/>
<Flex justifyContent="space-around" flexDirection="row" flexWrap="wrap">
{
compendium.map(
Expand Down
1 change: 1 addition & 0 deletions app/src/Home.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ const Template = (props) => (

export const HomeStory = Template.bind({});
HomeStory.args = {
stopped: true,
};
3 changes: 2 additions & 1 deletion app/src/components/typed-banner/TypedBanner.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ReactTyped from "react-typed";
import { Heading, Flex } from "rebass/styled-components";

const TypedBanner = ({ typedSentences }) => (
const TypedBanner = ({ typedSentences, stopped = false }) => (
<Flex px="20%" py={5} my={4} backgroundColor="secondary">
<Heading color="muted" sx={{ userSelect: "none" }}>
<ReactTyped
Expand All @@ -11,6 +11,7 @@ const TypedBanner = ({ typedSentences }) => (
backDelay={1}
loop
smartBackspace
stopped={stopped}
/>
</Heading>
</Flex>
Expand Down

0 comments on commit b530a3d

Please sign in to comment.