-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dossier): secondary cards #8
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6285986
feat(dossier): CardLayout component
aaadryyy f94bc97
feat(dossier): Link and Info icons
aaadryyy 5bd7f6f
refactor(dossier): AdditionalInfoCard
aaadryyy 137a222
refactor(dossier): CommiteeCard
aaadryyy 6fb8306
refactor(dossier): LegislativeDocumentCard
aaadryyy 9a82b83
refactor(dossier): DeputyPreview
aaadryyy bed1d46
feat(theme): Button
aaadryyy a4db64c
update textTransform only for secondary color
alexfauquette a365001
feat(button):add secondary buttons specific font weight and font size
aaadryyy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as React from "react"; | ||
import Card from "@mui/material/Card"; | ||
import CardContent from "@mui/material/CardContent"; | ||
import Typography from "@mui/material/Typography"; | ||
import Stack from "@mui/material/Stack"; | ||
import DeputyPreview from "../DeputyPreview"; | ||
|
||
interface CardLayoutProps { | ||
title: string; | ||
children: React.ReactNode; | ||
} | ||
|
||
const CardLayout = ({ title, children }: CardLayoutProps) => { | ||
return ( | ||
<Card elevation={0} sx={{ backgroundColor: "grey.50" }}> | ||
<CardContent sx={{ padding: 2 }}> | ||
<Typography variant="body1" fontWeight="bold" pb={3}> | ||
{title} | ||
</Typography> | ||
{children} | ||
</CardContent> | ||
</Card> | ||
); | ||
}; | ||
|
||
export default CardLayout; |
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,20 @@ | ||
import SvgIcon, { SvgIconProps } from "@mui/material/SvgIcon"; | ||
|
||
export default function InfoIcon(props: SvgIconProps) { | ||
return ( | ||
<SvgIcon {...props}> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="12" | ||
height="13" | ||
viewBox="0 0 12 13" | ||
fill="none" | ||
> | ||
<path | ||
d="M5.4 9.5H6.6V5.9H5.4V9.5ZM6 4.7C6.17 4.7 6.3125 4.6425 6.4275 4.5275C6.5425 4.4125 6.6 4.27 6.6 4.1C6.6 3.93 6.5425 3.7875 6.4275 3.6725C6.3125 3.5575 6.17 3.5 6 3.5C5.83 3.5 5.6875 3.5575 5.5725 3.6725C5.4575 3.7875 5.4 3.93 5.4 4.1C5.4 4.27 5.4575 4.4125 5.5725 4.5275C5.6875 4.6425 5.83 4.7 6 4.7ZM6 12.5C5.17 12.5 4.39 12.3425 3.66 12.0275C2.93 11.7125 2.295 11.285 1.755 10.745C1.215 10.205 0.7875 9.57 0.4725 8.84C0.1575 8.11 0 7.33 0 6.5C0 5.67 0.1575 4.89 0.4725 4.16C0.7875 3.43 1.215 2.795 1.755 2.255C2.295 1.715 2.93 1.2875 3.66 0.9725C4.39 0.6575 5.17 0.5 6 0.5C6.83 0.5 7.61 0.6575 8.34 0.9725C9.07 1.2875 9.705 1.715 10.245 2.255C10.785 2.795 11.2125 3.43 11.5275 4.16C11.8425 4.89 12 5.67 12 6.5C12 7.33 11.8425 8.11 11.5275 8.84C11.2125 9.57 10.785 10.205 10.245 10.745C9.705 11.285 9.07 11.7125 8.34 12.0275C7.61 12.3425 6.83 12.5 6 12.5ZM6 11.3C7.34 11.3 8.475 10.835 9.405 9.905C10.335 8.975 10.8 7.84 10.8 6.5C10.8 5.16 10.335 4.025 9.405 3.095C8.475 2.165 7.34 1.7 6 1.7C4.66 1.7 3.525 2.165 2.595 3.095C1.665 4.025 1.2 5.16 1.2 6.5C1.2 7.84 1.665 8.975 2.595 9.905C3.525 10.835 4.66 11.3 6 11.3Z" | ||
fill="#ADB5BD" | ||
/> | ||
</svg> | ||
</SvgIcon> | ||
); | ||
} |
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,20 @@ | ||
import SvgIcon, { SvgIconProps } from "@mui/material/SvgIcon"; | ||
|
||
export default function LinkIcon(props: SvgIconProps) { | ||
return ( | ||
<SvgIcon {...props}> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="14" | ||
height="15" | ||
viewBox="0 0 14 15" | ||
fill="none" | ||
> | ||
<path | ||
d="M6.3 11H3.5C2.53167 11 1.70625 10.6588 1.02375 9.97625C0.34125 9.29375 0 8.46833 0 7.5C0 6.53167 0.34125 5.70625 1.02375 5.02375C1.70625 4.34125 2.53167 4 3.5 4H6.3V5.4H3.5C2.91667 5.4 2.42083 5.60417 2.0125 6.0125C1.60417 6.42083 1.4 6.91667 1.4 7.5C1.4 8.08333 1.60417 8.57917 2.0125 8.9875C2.42083 9.39583 2.91667 9.6 3.5 9.6H6.3V11ZM4.2 8.2V6.8H9.8V8.2H4.2ZM7.7 11V9.6H10.5C11.0833 9.6 11.5792 9.39583 11.9875 8.9875C12.3958 8.57917 12.6 8.08333 12.6 7.5C12.6 6.91667 12.3958 6.42083 11.9875 6.0125C11.5792 5.60417 11.0833 5.4 10.5 5.4H7.7V4H10.5C11.4683 4 12.2937 4.34125 12.9762 5.02375C13.6587 5.70625 14 6.53167 14 7.5C14 8.46833 13.6587 9.29375 12.9762 9.97625C12.2937 10.6588 11.4683 11 10.5 11H7.7Z" | ||
fill="#171B1E" | ||
/> | ||
</svg> | ||
</SvgIcon> | ||
); | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexfauquette any idea how to remove uppercase on secondary buttons but keep it on the others (primary, tabs...)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can apply this style to the className
containedSecondary
class: https://mui.com/material-ui/api/button/#Button-css-containedSecondary It exists also for the other variantsThen maybe better to move this
textTransform
to the style overridehttps://mui.com/material-ui/customization/theme-components/#theme-style-overrides
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So should I also move the
fontSize
andfontWeight
in the style override?I am not sure how to style the
containedSecondary
className properly (other than in a .css file).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have multiple choices
https://mui.com/material-ui/customization/theme-components/#theme-style-overrides
Usually you can write a CSS selector as a key, using
&
to target the current element.As an example, you have in the codebase the following code. The same type of property can be use in styleOverride
But I found an easier one for your issue. I just commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I added the
fontSize
andfontWeight
to the fonction in the following commit 👇 .It felt weird not to use the global theme for buttons, as those will (probably) be reused everywhere.