@unitedstatespowersquadrons/components 1.4.5 → 1.4.6-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Admin/AdminLink.tsx +20 -63
- package/package.json +1 -1
package/Admin/AdminLink.tsx
CHANGED
|
@@ -1,95 +1,58 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { createUseStyles } from "react-jss";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
-
import AdminItem from "./AdminItem";
|
|
5
4
|
import Colors, { ButtonColorName } from "../Colors";
|
|
6
|
-
import { FontAwesomeProps } from "../FontAwesomeIcon";
|
|
7
|
-
import IconButton from "../IconButton";
|
|
5
|
+
import FontAwesomeIcon, { FontAwesomeProps } from "../FontAwesomeIcon";
|
|
8
6
|
import Styles from "../Styles";
|
|
9
7
|
|
|
10
8
|
// Styles aren't tree-shaken, but keeping every color variant here means apps
|
|
11
9
|
// can pass any ButtonColorName without needing to know which ones are wired up.
|
|
12
10
|
const useStyles = createUseStyles({
|
|
13
11
|
blue: {
|
|
14
|
-
"
|
|
15
|
-
"&:hover": {
|
|
16
|
-
"& button": { ...Styles.hover.blue },
|
|
17
|
-
...Styles.hover.blue,
|
|
18
|
-
},
|
|
12
|
+
"&:hover": { ...Styles.hover.blue },
|
|
19
13
|
...Styles.blue,
|
|
20
14
|
},
|
|
21
15
|
darkGray: {
|
|
22
|
-
"
|
|
23
|
-
"&:hover": {
|
|
24
|
-
"& button": { ...Styles.darkGray },
|
|
25
|
-
...Styles.darkGray,
|
|
26
|
-
},
|
|
16
|
+
"&:hover": { ...Styles.darkGray },
|
|
27
17
|
...Styles.darkGray,
|
|
28
18
|
},
|
|
29
19
|
gray: {
|
|
30
|
-
"
|
|
31
|
-
"&:hover": {
|
|
32
|
-
"& button": { ...Styles.hover.gray },
|
|
33
|
-
...Styles.hover.gray,
|
|
34
|
-
},
|
|
20
|
+
"&:hover": { ...Styles.hover.gray },
|
|
35
21
|
...Styles.gray,
|
|
36
22
|
},
|
|
37
23
|
green: {
|
|
38
|
-
"
|
|
39
|
-
"&:hover": {
|
|
40
|
-
"& button": { ...Styles.hover.green },
|
|
41
|
-
...Styles.hover.green,
|
|
42
|
-
},
|
|
24
|
+
"&:hover": { ...Styles.hover.green },
|
|
43
25
|
...Styles.green,
|
|
44
26
|
},
|
|
45
27
|
item: {
|
|
46
|
-
"& > span": { display: "none" },
|
|
47
28
|
"&:hover": { backgroundColor: Colors.shades._a },
|
|
48
|
-
"&:
|
|
29
|
+
"&:not(:last-child)": { padding: "0.5em 0.1em" },
|
|
30
|
+
...Styles.flexRow,
|
|
31
|
+
borderRadius: "0.5em",
|
|
49
32
|
cursor: "pointer",
|
|
33
|
+
justifyContent: "left",
|
|
34
|
+
textAlign: "left",
|
|
35
|
+
textDecoration: "none",
|
|
36
|
+
width: "100%",
|
|
50
37
|
},
|
|
51
|
-
left: { textAlign: "left" },
|
|
52
38
|
orange: {
|
|
53
|
-
"
|
|
54
|
-
"&:hover": {
|
|
55
|
-
"& button": { ...Styles.hover.orange },
|
|
56
|
-
...Styles.hover.orange,
|
|
57
|
-
},
|
|
39
|
+
"&:hover": { ...Styles.hover.orange },
|
|
58
40
|
...Styles.orange,
|
|
59
41
|
},
|
|
60
42
|
purple: {
|
|
61
|
-
"
|
|
62
|
-
"&:hover": {
|
|
63
|
-
"& button": { ...Styles.hover.purple },
|
|
64
|
-
...Styles.hover.purple,
|
|
65
|
-
},
|
|
43
|
+
"&:hover": { ...Styles.hover.purple },
|
|
66
44
|
...Styles.purple,
|
|
67
45
|
},
|
|
68
46
|
red: {
|
|
69
|
-
"
|
|
70
|
-
"&:hover": {
|
|
71
|
-
"& button": { ...Styles.hover.red },
|
|
72
|
-
...Styles.hover.red,
|
|
73
|
-
},
|
|
47
|
+
"&:hover": { ...Styles.hover.red },
|
|
74
48
|
...Styles.red,
|
|
75
49
|
},
|
|
76
50
|
subMenuIcon: {
|
|
77
51
|
fontSize: "1.5em",
|
|
78
|
-
gap: "0",
|
|
79
|
-
paddingLeft: "0",
|
|
80
|
-
paddingRight: "0",
|
|
81
|
-
},
|
|
82
|
-
subMenuLink: {
|
|
83
|
-
color: "inherit",
|
|
84
|
-
cursor: "pointer",
|
|
85
|
-
flex: 1,
|
|
86
|
-
textDecoration: "none",
|
|
87
52
|
},
|
|
88
53
|
subMenuText: {
|
|
89
54
|
animation: "fadeIn 100ms",
|
|
90
55
|
fontSize: "1.5em",
|
|
91
|
-
gap: "0",
|
|
92
|
-
paddingRight: "0.5em",
|
|
93
56
|
},
|
|
94
57
|
});
|
|
95
58
|
|
|
@@ -105,23 +68,17 @@ const AdminLink = (props: Props) => {
|
|
|
105
68
|
const { className, color, fa, href, icon, mode, style, subMenu, title } = props;
|
|
106
69
|
const classes = useStyles();
|
|
107
70
|
|
|
108
|
-
const colorClassName = classes[color];
|
|
109
|
-
|
|
110
71
|
return(
|
|
111
|
-
<
|
|
112
|
-
<
|
|
113
|
-
|
|
72
|
+
<a className={classNames(classes.item, classes[color])} href={href} title={title}>
|
|
73
|
+
<FontAwesomeIcon
|
|
74
|
+
css={classNames(classes.subMenuIcon, className)}
|
|
114
75
|
fa={fa}
|
|
115
|
-
href={href}
|
|
116
76
|
icon={icon}
|
|
117
77
|
mode={mode}
|
|
118
78
|
style={style}
|
|
119
|
-
title={title}
|
|
120
79
|
/>
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
</a>
|
|
124
|
-
</AdminItem>
|
|
80
|
+
<span className={classNames(classes.subMenuText, className)}>{subMenu}</span>
|
|
81
|
+
</a>
|
|
125
82
|
);
|
|
126
83
|
};
|
|
127
84
|
|