Skip to content

Commit d61efab

Browse files
committed
feat(Tag): tag component, category/keyword options
1 parent bda3d5c commit d61efab

File tree

3 files changed

+88
-16
lines changed

3 files changed

+88
-16
lines changed

app/components/item/Tag.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react'
2+
import classNames from 'classnames'
3+
4+
interface TagProps {
5+
type: 'category' | 'keyword'
6+
tag: string
7+
}
8+
9+
const Tag: React.FunctionComponent<TagProps> = (props) => {
10+
const { type = 'category', tag } = props
11+
return (
12+
<div className={classNames('tag', { 'category': type === 'category' })}>
13+
{tag}
14+
</div>
15+
)
16+
}
17+
18+
export default Tag

app/scss/0.4.0/item.scss

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,56 @@
7777
}
7878
}
7979
}
80+
}
81+
82+
.tag {
83+
font-size: 14px;
84+
color: #AFD148;
85+
padding: 3px 5px;
86+
letter-spacing: .5px;
87+
88+
&.category {
89+
color: #F8AB31;
90+
background: #F2F2F2;
91+
border-radius: 2px;
92+
}
93+
}
94+
95+
96+
.dataset-item {
97+
padding: 20px;
98+
background: white;
99+
border-radius: 5px;
100+
border: 1px solid #E8EDF2;
101+
max-width: 600px;
102+
103+
.header {
104+
display: flex;
105+
justify-content: space-between;
106+
align-items: center;
107+
a {
108+
font-family: $font-family-sans-serif;
109+
text-overflow: ellipsis;
110+
font-size: 24px;
111+
font-weight: 500;
112+
flex: 1 1 auto;
113+
overflow: hidden;
114+
white-space: nowrap;
115+
}
116+
div {
117+
flex: 0 0 auto;
118+
}
119+
}
120+
121+
.title {
122+
color: #595959;
123+
margin: 10px 0px;
124+
font-size: 19px;
125+
text-overflow: ellipsis;
126+
}
127+
128+
.detail {
129+
margin-right: 10px;
130+
width: 100%;
131+
}
80132
}

app/scss/_forms.scss

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -526,28 +526,30 @@ input#path, input#bodyPath {
526526
}
527527

528528
// MultiTextInput (tags UI)
529-
.tag {
530-
background: #e4e4e4;
531-
border-radius: 4px;
532-
padding: 4px 8px;
533-
margin: 5px;
534-
display: inline-block;
529+
.multi-text-input {
530+
.tag {
531+
background: #e4e4e4;
532+
border-radius: 4px;
533+
padding: 4px 8px;
534+
margin: 5px;
535+
display: inline-block;
536+
537+
.tag-text {
538+
flex: 1;
539+
}
535540

536-
.tag-text {
537-
flex: 1;
541+
.tag-remove {
542+
flex: 0;
543+
padding-left: 7px;
544+
}
538545
}
539546

540-
.tag-remove {
541-
flex: 0;
542-
padding-left: 7px;
547+
.tag-input {
548+
max-width: 180px;
549+
display: inline-block;
543550
}
544551
}
545552

546-
.tag-input {
547-
max-width: 180px;
548-
display: inline-block;
549-
}
550-
551553
// MultiStructuredInput
552554

553555
.subform-container {

0 commit comments

Comments
 (0)