-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
splash page: add user groups section
If a user is signed in, they can see a "groups" section on the splash page that lists all of their groups. Currently the group tiles use an "empty" image with a background color. The background colors rotate through the titleColors listed in theme.js.
- Loading branch information
1 parent
0cc4a64
commit 24c7437
Showing
5 changed files
with
50 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React, { Fragment } from "react"; | ||
import ScrollableAnchor from "react-scrollable-anchor"; | ||
import * as Styles from "./styles"; | ||
import Cards from "../Cards"; | ||
import { HugeSpacer, FlexCenter } from "../../layouts/generalComponents"; | ||
import { theme } from "../../layouts/theme"; | ||
|
||
const UserGroups = (props) => { | ||
|
||
const colors = [...theme.titleColors]; | ||
|
||
const groupCards = props.user.groups.map((group) => { | ||
const groupColor = colors[0]; | ||
colors.push(colors.shift()); | ||
|
||
return ( | ||
{ | ||
img: "empty.png", | ||
url: `/groups/${group}`, | ||
title: group, | ||
color: groupColor | ||
} | ||
); | ||
}); | ||
|
||
return ( | ||
<Fragment> | ||
<ScrollableAnchor id={'groups'}> | ||
<Styles.H1> {props.user.username}'s Groups</Styles.H1> | ||
</ScrollableAnchor> | ||
|
||
<FlexCenter> | ||
<Styles.CenteredFocusParagraph> | ||
You have access to the following groups: | ||
</Styles.CenteredFocusParagraph> | ||
</FlexCenter> | ||
|
||
<Cards cards={groupCards}/> | ||
|
||
<HugeSpacer/> | ||
</Fragment> | ||
); | ||
}; | ||
|
||
export default UserGroups; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.