-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move create new list button to under the list of lists, remove the grid from the header * move UserListCardTemplate to ol-components and rename it to UserListCardCondensed * use routes instead of location hash for dashboard urls * set up userlist detail route and list card href, remove standalone userlist page * refactor active tab logic to match new route strategy * fix typography import path on userlistcardcondensed * default to dashboard home if tabValue ends up being something unexpected * use proper syntax for checking the tabValue... * get tests functioning again * fix accessible title in UserListCardCondensed * commit broken test * make UserListCardCondensed the default export from that component * fix link clicking test * restyle dashboard user list view component * Add button to go back to My Lists * fix testing issues * fix rebase issues with new settings tab * hide UserListCardCondensed icon on mobile * create new list button should be 100% width on mobile * get rid of profile type check
- Loading branch information
Showing
19 changed files
with
559 additions
and
607 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
15 changes: 7 additions & 8 deletions
15
...ardTemplate/UserListCardTemplate.test.tsx → ...erListCard/UserListCardCondensed.test.tsx
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
75 changes: 75 additions & 0 deletions
75
frontends/mit-open/src/page-components/UserListCard/UserListCardCondensed.tsx
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,75 @@ | ||
import React from "react" | ||
import { UserList } from "api" | ||
import { pluralize } from "ol-utilities" | ||
import { RiListCheck3 } from "@remixicon/react" | ||
import { ListCardCondensed, styled, theme, Typography } from "ol-components" | ||
|
||
const StyledCard = styled(ListCardCondensed)({ | ||
display: "flex", | ||
alignItems: "center", | ||
padding: "16px", | ||
margin: "0", | ||
gap: "16px", | ||
width: "100%", | ||
}) | ||
|
||
const TextContainer = styled.div({ | ||
display: "flex", | ||
flexDirection: "column", | ||
alignItems: "flex-start", | ||
gap: "8px", | ||
flex: "1 0 0", | ||
}) | ||
|
||
const ItemsText = styled(Typography)(({ theme }) => ({ | ||
color: theme.custom.colors.silverGrayDark, | ||
})) | ||
|
||
const IconContainer = styled.div(({ theme }) => ({ | ||
display: "flex", | ||
alignItems: "center", | ||
gap: "8px", | ||
borderRadius: "4px", | ||
color: theme.custom.colors.silverGrayDark, | ||
background: theme.custom.colors.lightGray1, | ||
[theme.breakpoints.down("sm")]: { | ||
display: "none", | ||
}, | ||
})) | ||
|
||
type UserListCardCondensedProps<U extends UserList = UserList> = { | ||
userList: U | ||
href?: string | ||
className?: string | ||
} | ||
|
||
const UserListCardCondensed = <U extends UserList>({ | ||
userList, | ||
href, | ||
className, | ||
}: UserListCardCondensedProps<U>) => { | ||
return ( | ||
<StyledCard href={href} className={className}> | ||
<ListCardCondensed.Content> | ||
<TextContainer> | ||
<Typography | ||
variant="subtitle1" | ||
color={theme.custom.colors.darkGray2} | ||
component="h1" | ||
> | ||
{userList.title} | ||
</Typography> | ||
<ItemsText variant="body3"> | ||
{userList.item_count} {pluralize("item", userList.item_count)} | ||
</ItemsText> | ||
</TextContainer> | ||
<IconContainer> | ||
<RiListCheck3 size="48" /> | ||
</IconContainer> | ||
</ListCardCondensed.Content> | ||
</StyledCard> | ||
) | ||
} | ||
|
||
export default UserListCardCondensed | ||
export type { UserListCardCondensedProps } |
69 changes: 0 additions & 69 deletions
69
frontends/mit-open/src/page-components/UserListCardTemplate/UserListCardTemplate.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.