Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pubsweet
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giorgio Sironi
pubsweet
Commits
f90d98c3
Commit
f90d98c3
authored
7 years ago
by
Aanand Prasad
Committed by
Jure
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
feat(ui): convert Attachments to a styled component
parent
c8a3b390
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/ui/src/molecules/Attachments.js
+28
-9
28 additions, 9 deletions
packages/ui/src/molecules/Attachments.js
packages/ui/src/molecules/Attachments.local.scss
+0
-15
0 additions, 15 deletions
packages/ui/src/molecules/Attachments.local.scss
with
28 additions
and
24 deletions
packages/ui/src/molecules/Attachments.js
+
28
−
9
View file @
f90d98c3
import
React
from
'
react
'
import
styled
from
'
styled-components
'
import
Files
from
'
./Files
'
import
Attachment
from
'
../atoms/Attachment
'
import
classes
from
'
./Attachments.local.scss
'
import
Icon
from
'
../atoms/Icon
'
// TODO: show upload progress
const
Root
=
styled
.
div
`
display: flex;
flex-direction: column;
margin-bottom: 2em;
margin-top: 2em;
`
const
Paperclip
=
styled
.
span
`
color: gray;
margin-right: 10px;
`
const
Filename
=
styled
.
span
`
color: gray;
`
const
UploadingFile
=
({
file
,
progress
,
error
})
=>
(
<
Root
>
<
Paperclip
>
<
Icon
color
=
"
var(--color-local, black)
"
>
paperclip
<
/Icon
>
<
/Paperclip
>
<
Filename
>
{
error
||
'
Uploading…
'
}
<
/Filename
>
<
/Root
>
)
const
Attachments
=
props
=>
(
<
Files
{...
props
}
buttonText
=
"
Attach file
"
uploadedFile
=
{
value
=>
<
Attachment
key
=
{
value
.
url
}
value
=
{
value
}
/>
}
uploadingFile
=
{({
file
,
progress
,
error
})
=>
(
<
div
className
=
{
classes
.
uploading
}
>
<
span
className
=
{
classes
.
icon
}
>
<
Icon
color
=
"
var(--color-local, black)
"
>
paperclip
<
/Icon
>
<
/span
>
<
span
className
=
{
classes
.
filename
}
>
{
error
||
'
Uploading…
'
}
<
/span
>
<
/div
>
)}
uploadingFile
=
{
UploadingFile
}
/
>
)
...
...
This diff is collapsed.
Click to expand it.
packages/ui/src/molecules/Attachments.local.scss
deleted
100644 → 0
+
0
−
15
View file @
c8a3b390
.uploading
{
display
:
flex
;
flex-direction
:
column
;
margin-bottom
:
2em
;
margin-top
:
2em
;
}
.icon
{
color
:
gray
;
margin-right
:
10px
;
}
.filename
{
color
:
gray
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment