File tree 4 files changed +71
-44
lines changed
4 files changed +71
-44
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ import dangerButton from './danger.scss';
47
47
import defaultButton from './default.scss' ;
48
48
import primaryDesignButton from './primaryDesign.scss' ;
49
49
import secondaryButton from './secondary.scss' ;
50
+ import tagButton from './tags.scss' ;
50
51
51
52
/* Generic button, not wrapped by themr, but accepting theme property.
52
53
* In most cases you will want to use some of the themable exports below
@@ -123,4 +124,7 @@ export const PrimaryButton =
123
124
export const SecondaryButton =
124
125
themr ( 'SecondaryButton' , secondaryButton ) ( GenericButton ) ;
125
126
126
- export default undefined ;
127
+ export const TagButton =
128
+ themr ( 'TagButton' , tagButton ) ( GenericButton ) ;
129
+
130
+ export default undefined ;
Original file line number Diff line number Diff line change
1
+ /* *
2
+ * Challenge tag button, default style with white text on light blue background.
3
+ */
4
+ @import " ~styles/tc-styles" ;
5
+
6
+ @mixin feedback {
7
+ & :active ,
8
+ & :focus ,
9
+ & :hover {
10
+ color : $tc-white ;
11
+ }
12
+ }
13
+
14
+ .button {
15
+ border-radius : 3px ;
16
+ font-family : roboto;
17
+ font-size : 10px ;
18
+ line-height : 20px ;
19
+ margin : 5px 5px 0 0 ;
20
+ display : inline-block ;
21
+ text-align : center ;
22
+ padding : 0 5px ;
23
+ font-weight : 700 ;
24
+ color : $tc-white ;
25
+ background-color : $tc-light-blue-10 ;
26
+ & ,
27
+ & :visited {
28
+ color : $tc-white ;
29
+ }
30
+ }
31
+
32
+ .disabled {
33
+ background-color : $tc-gray-20 ;
34
+ }
35
+
36
+ .link ,
37
+ .regular {
38
+ @include feedback ;
39
+ }
Original file line number Diff line number Diff line change 9
9
import React from 'react' ;
10
10
import PT from 'prop-types' ;
11
11
import { Link } from 'utils/router' ;
12
-
13
- import './style.scss ';
12
+ import style from './style.scss' ;
13
+ import { TagButton } from 'components/buttons ';
14
14
15
15
export default function ChallengeTags ( props ) {
16
16
const {
@@ -23,34 +23,34 @@ export default function ChallengeTags(props) {
23
23
} = props ;
24
24
25
25
return (
26
- < div styleName = "tag-holder" >
26
+ < div >
27
27
{
28
28
subTrack &&
29
- < Link
30
- onClick = { ( ) => setChallengeListingFilter ( { subtracks : [ subTrack ] } ) }
29
+ < TagButton
31
30
to = "/challenges"
32
- styleName = { `tag-common ${ subTrackStyle } ` }
33
- > { subTrack } </ Link >
31
+ onClick = { ( ) => setChallengeListingFilter ( { subtracks : [ subTrack ] } ) }
32
+ theme = { { button : style [ subTrackStyle ] } }
33
+ > { subTrack } </ TagButton >
34
34
}
35
35
{
36
36
events . map ( event => (
37
- < a
38
- href = { `https://${ event } .topcoder.com` }
37
+ < TagButton
38
+ to = { `https://${ event } .topcoder.com` }
39
+ theme = { { button : style [ eventStyle ] } }
39
40
key = { event }
40
- styleName = { `tag-common ${ eventStyle } ` }
41
- > { event } </ a >
41
+ > { event } </ TagButton >
42
42
) )
43
43
}
44
44
{
45
45
technPlatforms . map (
46
46
tag =>
47
47
(
48
- < Link
49
- key = { tag }
50
- onClick = { ( ) => setChallengeListingFilter ( { tags : [ tag ] } ) }
48
+ < TagButton
51
49
to = "/challenges"
52
- styleName = "tag-common misc-tag"
53
- > { tag } </ Link >
50
+ onClick = { ( ) => setChallengeListingFilter ( { tags : [ tag ] } ) }
51
+ theme = { { button : style . miscTag } }
52
+ key = { tag }
53
+ > { tag } </ TagButton >
54
54
) ,
55
55
)
56
56
}
Original file line number Diff line number Diff line change 124
124
}
125
125
}
126
126
127
- .tag-holder {
128
- .tag-common {
129
- border-radius : 3px ;
130
- font-family : roboto;
131
- font-size : 10px ;
132
- line-height : 20px ;
133
- margin : 5px 5px 0 0 ;
134
- display : inline-block ;
135
- text-align : center ;
136
- padding : 0 5px ;
137
- font-weight : 700 ;
138
- color : $tc-white ;
139
- background-color : $tc-light-blue-10 ;
140
- }
141
-
142
- @include design-accent-bg ;
143
- @include develop-accent-bg ;
144
- @include datasci-accent-bg ;
145
- @include design-accent-clr ;
146
- @include develop-accent-clr ;
147
- @include datasci-accent-clr ;
148
-
149
- .misc-tag {
150
- color : $tc-gray-80 ;
151
- background-color : $tc-gray-neutral-dark ;
152
- cursor : pointer ;
153
- }
127
+ @include design-accent-bg ;
128
+ @include develop-accent-bg ;
129
+ @include datasci-accent-bg ;
130
+ @include design-accent-clr ;
131
+ @include develop-accent-clr ;
132
+ @include datasci-accent-clr ;
133
+
134
+ .miscTag {
135
+ color : $tc-gray-80 ;
136
+ background-color : $tc-gray-neutral-dark ;
137
+ cursor : pointer ;
154
138
}
155
139
156
140
.prizes-ops-container {
You can’t perform that action at this time.
0 commit comments