Changed value prop name to label for button label. Added sample buttons to home page
This commit is contained in:
1 parent
33f68ebbe3
commit
e333a8fdc8
3 files changed
+15
-5
No files matched your search
@@ -27,18 +27,18 @@ const levelConfig = {
|
|||||||
* @property {boolean} [disabled] - Whether the button is disabled
|
* @property {boolean} [disabled] - Whether the button is disabled
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const Button = ({ level, value, disabled }) => {
|
const Button = ({ level, label, disabled }) => {
|
||||||
const { variant, color } = levelConfig[level];
|
const { variant, color } = levelConfig[level];
|
||||||
return (
|
return (
|
||||||
<MuiButton variant={variant} color={color} disabled={disabled}>
|
<MuiButton variant={variant} color={color} disabled={disabled}>
|
||||||
{value}
|
{label}
|
||||||
</MuiButton>
|
</MuiButton>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
Button.propTypes = {
|
Button.propTypes = {
|
||||||
level: PropTypes.string.isRequired,
|
level: PropTypes.string.isRequired,
|
||||||
value: PropTypes.string.isRequired,
|
label: PropTypes.string.isRequired,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -8,13 +8,23 @@ const Home = () => {
|
|||||||
<>
|
<>
|
||||||
<div>Home</div>
|
<div>Home</div>
|
||||||
<DropdownTeamMember />
|
<DropdownTeamMember />
|
||||||
<div style={{ display: "flex", flexDirection: "flex-column" }}>
|
<div
|
||||||
|
style={{ display: "flex", flexDirection: "column", marginTop: "2rem" }}
|
||||||
|
>
|
||||||
|
<h4>Buttons</h4>
|
||||||
<div>
|
<div>
|
||||||
<Button level="primary" label="Primary" />
|
<Button level="primary" label="Primary" />
|
||||||
<Button level="secondary" label="Secondary" />
|
<Button level="secondary" label="Secondary" />
|
||||||
<Button level="tertiary" label="Tertiary" />
|
<Button level="tertiary" label="Tertiary" />
|
||||||
<Button level="error" label="Error" />
|
<Button level="error" label="Error" />
|
||||||
</div>
|
</div>
|
||||||
|
<h4>Disabled Buttons</h4>
|
||||||
|
<div>
|
||||||
|
<Button level="primary" label="Primary" disabled />
|
||||||
|
<Button level="secondary" label="Secondary" disabled />
|
||||||
|
<Button level="tertiary" label="Tertiary" disabled />
|
||||||
|
<Button level="error" label="Error" disabled />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -70,4 +70,4 @@ button:focus-visible {
|
|||||||
button {
|
button {
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user