Skip to content

Commit 4b5ee6a

Browse files
feat: unlock full version button && prettier add
1 parent ec6763a commit 4b5ee6a

File tree

4 files changed

+42
-5
lines changed

4 files changed

+42
-5
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@
4141
"last 1 firefox version",
4242
"last 1 safari version"
4343
]
44+
},
45+
"devDependencies": {
46+
"prettier": "^1.19.1"
4447
}
4548
}

src/components/Header/Header.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Menu,
88
MenuItem,
99
Fab,
10+
Link
1011
} from "@material-ui/core";
1112
import {
1213
Menu as MenuIcon,
@@ -23,7 +24,7 @@ import classNames from "classnames";
2324
import useStyles from "./styles";
2425

2526
// components
26-
import { Badge, Typography } from "../Wrappers/Wrappers";
27+
import { Badge, Typography, Button } from "../Wrappers/Wrappers";
2728
import Notification from "../Notification/Notification";
2829
import UserAvatar from "../UserAvatar/UserAvatar";
2930

@@ -139,6 +140,7 @@ export default function Header(props) {
139140
React Material Admin
140141
</Typography>
141142
<div className={classes.grow} />
143+
<Button component={Link} href="https://flatlogic.com/templates/react-material-admin-full" variant={"outlined"} color={"secondary"} style={{marginRight: 24}}>Unlock full version</Button>
142144
<div
143145
className={classNames(classes.search, {
144146
[classes.searchFocused]: isSearchOpen,

src/components/Wrappers/Wrappers.js

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,52 @@ function Typography({
6666
);
6767
}
6868

69-
function Button({ children, color, ...props }) {
69+
function Button({ children, color, className, ...props }) {
7070
var theme = useTheme();
7171

7272
var Styled = createStyled({
73-
button: {
73+
root: {
74+
color: getColor(color, theme),
75+
},
76+
contained: {
7477
backgroundColor: getColor(color, theme),
7578
boxShadow: theme.customShadows.widget,
76-
color: "white",
79+
color: `${color ? "white" : theme.palette.text.primary} !important`,
7780
"&:hover": {
7881
backgroundColor: getColor(color, theme, "light"),
7982
boxShadow: theme.customShadows.widgetWide,
8083
},
84+
"&:active": {
85+
boxShadow: theme.customShadows.widgetWide,
86+
},
87+
},
88+
outlined: {
89+
color: getColor(color, theme),
90+
borderColor: getColor(color, theme),
91+
},
92+
select: {
93+
backgroundColor: theme.palette.primary.main,
94+
color: "#fff",
8195
},
8296
});
8397

8498
return (
8599
<Styled>
86100
{({ classes }) => (
87-
<ButtonBase classes={{ root: classes.button }} {...props}>
101+
<ButtonBase
102+
classes={{
103+
contained: classes.contained,
104+
root: classes.root,
105+
outlined: classes.outlined,
106+
}}
107+
{...props}
108+
className={classnames(
109+
{
110+
[classes.select]: props.select,
111+
},
112+
className,
113+
)}
114+
>
88115
{children}
89116
</ButtonBase>
90117
)}

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7181,6 +7181,11 @@ prelude-ls@~1.1.2:
71817181
version "1.1.2"
71827182
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
71837183

7184+
prettier@^1.19.1:
7185+
version "1.19.1"
7186+
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
7187+
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
7188+
71847189
pretty-bytes@^5.1.0:
71857190
version "5.3.0"
71867191
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.3.0.tgz#f2849e27db79fb4d6cfe24764fc4134f165989f2"

0 commit comments

Comments
 (0)