Skip to content

Commit

Permalink
fix(suggestions): add no suggestions message
Browse files Browse the repository at this point in the history
  • Loading branch information
newick authored and lutangar committed Oct 4, 2019
1 parent ff5c40a commit eec1c53
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ storiesOf('screens/SuggestionsScreen', module)
subscribe={() => action('subscribe')}
unsubscribe={() => action('unsubscribe')}
/>
))
.add('no suggestions', () => (
<SuggestionsScreen
suggestions={[]}
subscribe={() => action('subscribe')}
unsubscribe={() => action('unsubscribe')}
/>
));
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ import styled from 'styled-components';
import { StatefulContributor } from 'app/lmem/contributor';
import ContributorLarge from 'components/organisms/Contributor/ContributorLarge';

const ContributorsWidth = styled.section`
padding-bottom: 250px;
`;

const ContributorsList = styled.div`
const ContributorsList = styled.section`
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
grid-column-gap: 40px;
grid-row-gap: 40px;
`;

const ContributorsListEmpty = styled.p`
text-align: center;
font-size: 18px;
color: ${props => props.theme.primaryColor};
`;

export interface SuggestionsScreenProps {
suggestions: StatefulContributor[];
subscribe: (contributor: StatefulContributor) => () => void;
Expand All @@ -30,7 +32,7 @@ const SuggestionsScreen = ({
highlightExampleLink
}: SuggestionsScreenProps) => (
<>
<ContributorsWidth>
{suggestions.length > 0 ? (
<ContributorsList>
{suggestions.map(contributor => (
<ContributorLarge
Expand All @@ -43,7 +45,11 @@ const SuggestionsScreen = ({
/>
))}
</ContributorsList>
</ContributorsWidth>
) : (
<ContributorsListEmpty>
Pas de suggestions pour le moment.
</ContributorsListEmpty>
)}
</>
);

Expand Down

0 comments on commit eec1c53

Please sign in to comment.