Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-06-03 23:54:34 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
401d3dad04d818ec1436351c684db23124274bc9
401d3dad
1 parent
3382b045
add DefaultIcon link
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
front/src/Components/ProfileIcon.js
front/src/Components/ProfileIcon.js
View file @
401d3da
import
React
from
"react"
;
import
styled
from
"styled-components"
;
import
DefaultIcon
from
"../imgs/defaultProfile.jpg"
;
const
ProfileIconBox
=
styled
.
div
`
display: flex;
...
...
@@ -16,11 +17,11 @@ const ProfileIcon = styled.img`
export
default
({
avatar
})
=>
{
if
(
avatar
===
""
)
{
avatar
=
"../imgs/defaultProfile.jpg"
;
console
.
log
(
"avatar link is empty"
)
;
}
return
(
<
ProfileIconBox
className
=
"ProfileIconBox"
>
<
ProfileIcon
src
=
{
avatar
}
/
>
<
ProfileIcon
src
=
{
DefaultIcon
}
/
>
<
/ProfileIconBox
>
);
};
...
...
Please
register
or
login
to post a comment