-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib-user: Add group create modal (#6009)
* Add CreateButton * Refactor Modal with bodyBackground prop * Init GroupModal component * Add GroupModal accessibility * Add init GroupForm * Refactor create user_group * Refactor GroupFormContainer create group * Refactor MyGroups create group * Init MyGroups grid refactor for small screens * Refactor text color for dark theme in GroupCard group displayName and TitledStat * Fix hover effect and spacing issue * Refactor GroupForm fields per design * Refactor GroupForm submit button * Add GroupForm tests * Add FormFields help * Fix GroupCardContainer import * Update CreateButton dark color
- Loading branch information
Showing
23 changed files
with
586 additions
and
117 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
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 was deleted.
Oops, something went wrong.
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,49 +1,30 @@ | ||
import { Grid, ResponsiveContext } from 'grommet' | ||
import { func, node } from 'prop-types' | ||
import { node } from 'prop-types' | ||
import { useContext } from 'react' | ||
|
||
import { ContentBox, Layout } from '@components/shared' | ||
import CreateGroup from './CreateGroup' | ||
|
||
const DEFAULT_HANDLER = () => true | ||
|
||
function MyGroups({ | ||
children, | ||
handleGroupCreate = DEFAULT_HANDLER | ||
children | ||
}) { | ||
const size = useContext(ResponsiveContext) | ||
const columnCount = size === 'small' ? 1 : 2 | ||
|
||
return ( | ||
<Layout> | ||
<ContentBox | ||
linkLabel='Learn more about Groups' | ||
linkProps={{ href: '/groups' }} | ||
title='My Groups' | ||
pad={{ horizontal: '60px', vertical: '30px' }} | ||
> | ||
<Grid | ||
as='ul' | ||
columns={{ | ||
count: columnCount, | ||
size: 'auto' | ||
}} | ||
gap={{ row: '20px', column: '40px' }} | ||
pad='none' | ||
> | ||
{children} | ||
</Grid> | ||
<CreateGroup | ||
handleGroupCreate={handleGroupCreate} | ||
/> | ||
</ContentBox> | ||
</Layout> | ||
<Grid | ||
as='ul' | ||
columns={{ | ||
count: columnCount, | ||
size: 'auto' | ||
}} | ||
gap={{ row: '20px', column: '40px' }} | ||
pad='none' | ||
> | ||
{children} | ||
</Grid> | ||
) | ||
} | ||
|
||
MyGroups.propTypes = { | ||
children: node, | ||
handleGroupCreate: func | ||
children: node | ||
} | ||
|
||
export default MyGroups |
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
14 changes: 14 additions & 0 deletions
14
packages/lib-user/src/components/MyGroups/components/CreateButton/AddIcon.js
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,14 @@ | ||
import { Blank } from 'grommet-icons' | ||
|
||
function AddIcon(props) { | ||
return ( | ||
<Blank | ||
viewBox='0 0 15 15' | ||
{...props} | ||
> | ||
<path d="M13.9286 9.07143H8.57143V14.4286C8.57143 15.0179 8.08929 15.5 7.5 15.5C6.91071 15.5 6.42857 15.0179 6.42857 14.4286V9.07143H1.07143C0.482143 9.07143 0 8.58929 0 8C0 7.41071 0.482143 6.92857 1.07143 6.92857H6.42857V1.57143C6.42857 0.982143 6.91071 0.5 7.5 0.5C8.08929 0.5 8.57143 0.982143 8.57143 1.57143V6.92857H13.9286C14.5179 6.92857 15 7.41071 15 8C15 8.58929 14.5179 9.07143 13.9286 9.07143Z" fill="#5C5C5C" /> | ||
</Blank> | ||
) | ||
} | ||
|
||
export default AddIcon |
Oops, something went wrong.