Tweak avatars

This commit is contained in:
Spectralitree 2020-12-14 23:23:47 +01:00
parent 58711528cd
commit a857d9db96
5 changed files with 18 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -90,7 +90,7 @@ export default function MemberCard(props) {
} else setPronouns('') } else setPronouns('')
if (member.avatar_url) { if (member.avatar_url) {
setAvatar(member.avatar_url) setAvatar(member.avatar_url.replace('?width=256&height=256&format=jpeg', ''))
} else setAvatar('') } else setAvatar('')
if (member.color) { if (member.color) {
@ -202,7 +202,7 @@ export default function MemberCard(props) {
{ member.avatar_url ? <Popup trigger={<BS.Image src={`${member.avatar_url}`} style={{width: 50, height: 50}} tabIndex="0" className="float-right" roundedCircle />} className="avatar" modal> { member.avatar_url ? <Popup trigger={<BS.Image src={`${member.avatar_url}`} style={{width: 50, height: 50}} tabIndex="0" className="float-right" roundedCircle />} className="avatar" modal>
{close => ( {close => (
<div className="text-center w-100 m-0" onClick={() => close()}> <div className="text-center w-100 m-0" onClick={() => close()}>
<BS.Image src={`${member.avatar_url}`} style={{width: 500, height: 'auto'}} thumbnail /> <BS.Image src={`${avatar}`} style={{width: 500, height: 'auto'}} thumbnail />
</div> </div>
)} )}
</Popup> : </Popup> :

View File

@ -18,6 +18,7 @@ export default function Profile () {
const [ tag, setTag ] = useState(""); const [ tag, setTag ] = useState("");
const [ timezone, setTimezone ] = useState(""); const [ timezone, setTimezone ] = useState("");
const [ desc, setDesc ] = useState(""); const [ desc, setDesc ] = useState("");
const [ avatar, setAvatar ] = useState('');
const [ isLoading, setIsLoading ] = useState(true); const [ isLoading, setIsLoading ] = useState(true);
const [ isError, setIsError ] = useState(false); const [ isError, setIsError ] = useState(false);
@ -44,6 +45,10 @@ export default function Profile () {
setName(system.name); setName(system.name);
} else setName(''); } else setName('');
if (system.avatar_url) {
setAvatar(system.avatar_url.replace('?width=256&height=256&format=jpeg', ''))
} else setAvatar('')
if (system.tag) { if (system.tag) {
setTag(system.tag); setTag(system.tag);
} else setTag(''); } else setTag('');
@ -66,7 +71,7 @@ export default function Profile () {
{ system.avatar_url ? <Popup trigger={<BS.Image src={`${system.avatar_url}`} style={{width: 50, height: 50}} tabIndex="0" className="float-right" roundedCircle />} className="avatar" modal> { system.avatar_url ? <Popup trigger={<BS.Image src={`${system.avatar_url}`} style={{width: 50, height: 50}} tabIndex="0" className="float-right" roundedCircle />} className="avatar" modal>
{close => ( {close => (
<div className="text-center w-100 m-0" onClick={() => close()}> <div className="text-center w-100 m-0" onClick={() => close()}>
<BS.Image src={`${system.avatar_url}`} style={{width: 500, height: 'auto'}} thumbnail /> <BS.Image src={`${avatar}`} style={{'max-width': 500, height: 'auto'}} thumbnail />
</div> </div>
)} )}
</Popup> : </Popup> :

View File

@ -14,6 +14,7 @@ export default function MemberCard(props) {
const member = props.member; const member = props.member;
const [ avatar, setAvatar ] = useState('')
const [ displayName, setDisplayName ] = useState(""); const [ displayName, setDisplayName ] = useState("");
const [ birthday, setBirthday ] = useState(""); const [ birthday, setBirthday ] = useState("");
const [ pronouns, setPronouns ] = useState(""); const [ pronouns, setPronouns ] = useState("");
@ -46,6 +47,10 @@ export default function MemberCard(props) {
} else { setBirthday(''); } else { setBirthday('');
} }
if (member.avatar_url) {
setAvatar(member.avatar_url.replace('?width=256&height=256&format=jpeg', ''))
} else setAvatar('')
if (member.pronouns) { if (member.pronouns) {
setPronouns(member.pronouns) setPronouns(member.pronouns)
} else setPronouns('') } else setPronouns('')
@ -66,7 +71,7 @@ export default function MemberCard(props) {
{ member.avatar_url ? <Popup trigger={<BS.Image src={`${member.avatar_url}`} style={{width: 50, height: 50}} tabIndex="0" className="float-right" roundedCircle />} className="avatar" modal> { member.avatar_url ? <Popup trigger={<BS.Image src={`${member.avatar_url}`} style={{width: 50, height: 50}} tabIndex="0" className="float-right" roundedCircle />} className="avatar" modal>
{close => ( {close => (
<div className="text-center w-100 m-0" onClick={() => close()}> <div className="text-center w-100 m-0" onClick={() => close()}>
<BS.Image src={`${member.avatar_url}`} style={{width: 500, height: 'auto'}} thumbnail /> <BS.Image src={`${avatar}`} style={{'max-width': 500, height: 'auto'}} thumbnail />
</div> </div>
)} )}
</Popup> : </Popup> :

View File

@ -59,7 +59,7 @@ export default function System(props) {
} else setTimezone(''); } else setTimezone('');
if (user.avatar_url) { if (user.avatar_url) {
setAvatar(user.avatar_url) setAvatar(user.avatar_url.replace('?width=256&height=256&format=jpeg', ''))
} else setAvatar('') } else setAvatar('')
if (user.description) { if (user.description) {
@ -118,7 +118,7 @@ const submitPrivacy = data => {
{ user.avatar_url ? <Popup trigger={<BS.Image src={`${user.avatar_url}`} style={{width: 50, height: 50}} tabIndex="0" className="float-right" roundedCircle />} className="avatar" modal> { user.avatar_url ? <Popup trigger={<BS.Image src={`${user.avatar_url}`} style={{width: 50, height: 50}} tabIndex="0" className="float-right" roundedCircle />} className="avatar" modal>
{close => ( {close => (
<div className="text-center w-100 m-0" onClick={() => close()}> <div className="text-center w-100 m-0" onClick={() => close()}>
<BS.Image src={`${user.avatar_url}`} style={{width: 500, height: 'auto'}} thumbnail /> <BS.Image src={`${avatar}`} style={{'max-width': 500, height: 'auto'}} thumbnail />
</div> </div>
)} )}
</Popup> : </Popup> :