Skip to content
Snippets Groups Projects
Commit 8c40c6a4 authored by lfr20's avatar lfr20
Browse files

change positions according width

parent 9b6098fa
No related branches found
No related tags found
6 merge requests!57Merge of develop into master,!56Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...,!39Update admin system,!32Homologa,!31Fix console error,!29Training materials into fix console error
...@@ -27,6 +27,8 @@ import ModalAlterarCover from '../ModalAlterarCover/ModalAlterarCover.js' ...@@ -27,6 +27,8 @@ import ModalAlterarCover from '../ModalAlterarCover/ModalAlterarCover.js'
export default function Cover (props) { export default function Cover (props) {
const {state} = useContext(Store) const {state} = useContext(Store)
const WIDTH = window.innerWidth;
const [currentCover, setCoverImg] = useState(state.currentUser.cover_file_name) const [currentCover, setCoverImg] = useState(state.currentUser.cover_file_name)
const [tempCover, setTempCover] = useState('') const [tempCover, setTempCover] = useState('')
...@@ -55,11 +57,21 @@ export default function Cover (props) { ...@@ -55,11 +57,21 @@ export default function Cover (props) {
{currentCover && <img src={apiDomain + currentCover} alt = '' style= {{width:"100%", height:"100%", objectFit : "cover" }}/>} {currentCover && <img src={apiDomain + currentCover} alt = '' style= {{width:"100%", height:"100%", objectFit : "cover" }}/>}
<input accept="image/*" style = {{display:"none"}} id="choose-cover-file" type="file" onChange={(e) => updateCover(e.target.files)}/> <input accept="image/*" style = {{display:"none"}} id="choose-cover-file" type="file" onChange={(e) => updateCover(e.target.files)}/>
<label htmlFor="choose-cover-file"> <label htmlFor="choose-cover-file">
{
WIDTH >= 545 ?
<Tooltip title={<span style={{fontSize:"14px", overflow:"hidden", transition:"all .5s ease"}}>ALTERAR CAPA</span>} placement="left">
<IconButton style={{position:"absolute",right:"0",bottom: "0",color:"#fff"}}color="primary" aria-label="upload picture" component="span">
<PhotoCamera />
</IconButton>
</Tooltip>
:
<Tooltip title={<span style={{fontSize:"14px", overflow:"hidden", transition:"all .5s ease"}}>ALTERAR CAPA</span>} placement="left"> <Tooltip title={<span style={{fontSize:"14px", overflow:"hidden", transition:"all .5s ease"}}>ALTERAR CAPA</span>} placement="left">
<IconButton style={{position:"absolute",right:"0",top:"0",color:"#fff"}}color="primary" aria-label="upload picture" component="span"> <IconButton style={{position:"absolute",left:"0",top: "0",color:"#fff"}}color="primary" aria-label="upload picture" component="span">
<PhotoCamera /> <PhotoCamera />
</IconButton> </IconButton>
</Tooltip> </Tooltip>
}
</label> </label>
</CoverContainer> </CoverContainer>
</> </>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment