diff --git a/src/Components/Private/MemberCard.js b/src/Components/Private/MemberCard.js index d6a0d8dd..dad641c2 100644 --- a/src/Components/Private/MemberCard.js +++ b/src/Components/Private/MemberCard.js @@ -23,6 +23,7 @@ export default function MemberCard(props) { const [ displayName, setDisplayName ] = useState(""); const [ birthday, setBirthday ] = useState(""); const [ birthdate, setBirthdate ] = useState(""); + const [ created, setCreated ] = useState(""); const [ pronouns, setPronouns ] = useState(""); const [ editPronouns, setEditPronouns ] = useState(""); const [ avatar, setAvatar ] = useState(""); @@ -32,10 +33,10 @@ export default function MemberCard(props) { const [ proxyTags, setProxyTags ] = useState(member.proxy_tags); const [ editMode, setEditMode ] = useState(false); - const [ privacyMode, setPrivacyMode ] = useState(false); + const [ privacyEdit, setprivacyEdit ] = useState(false); const [ privacyView, setPrivacyView ] = useState(false); const [ proxyView, setProxyView ] = useState(false); - const [ proxyMode, setProxyMode ] = useState(false); + const [ proxyEdit, setproxyEdit ] = useState(false); const [open, setOpen] = useState(false); const closeModal = () => setOpen(false); @@ -88,6 +89,9 @@ export default function MemberCard(props) { setBirthdate(''); } + var createdmoment = moment(member.created).format('MMM D, YYYY'); + setCreated(createdmoment); + if (member.pronouns) { setPronouns(toHTML(member.pronouns)); setEditPronouns(member.pronouns); @@ -110,7 +114,7 @@ export default function MemberCard(props) { } else { setDesc("(no description)"); setEditDesc(""); } - }, [member.description, member.color, member.birthday, member.display_name, member.pronouns, member.avatar_url, member.proxy_tags]); + }, [member.description, member.color, member.birthday, member.display_name, member.pronouns, member.avatar_url, member.proxy_tags, member.created]); const submitEdit = data => { props.edit(Object.assign(member, data)); @@ -146,7 +150,7 @@ export default function MemberCard(props) { ).then (data => { setMember(prevState => {return {...prevState, ...data}}); setErrorAlert(false); - setPrivacyMode(false) + setprivacyEdit(false) } ).catch (error => { console.error(error); @@ -178,7 +182,7 @@ export default function MemberCard(props) { } function resetProxyFields() { - setProxyMode(false); + setproxyEdit(false); setProxyTags(member.proxy_tags); } @@ -198,7 +202,7 @@ export default function MemberCard(props) { setMember(prevState => {return {...prevState, ...data}}); setProxyTags(data.proxy_tags); setErrorAlert(false); - setProxyMode(false); + setproxyEdit(false); } ).catch (error => { console.error(error); @@ -290,9 +294,9 @@ export default function MemberCard(props) { { member.color ? Color: {color} : "" } { privacyView ? "" : proxyView ? "" : Privacy: setPrivacyView(true)}>View } { privacyView ? "" : proxyView ? "" : Proxy tags: setProxyView(true)}>View } - + Created: {created} - { privacyMode ? + { privacyEdit ?
Editing privacy settings
@@ -346,7 +350,7 @@ export default function MemberCard(props) { - setPrivacyMode(false)}>Cancel Submit + setprivacyEdit(false)}>Cancel Submit
: privacyView ? <>
Viewing privacy settings
@@ -359,9 +363,9 @@ export default function MemberCard(props) { Pronouns: {member.pronoun_privacy} Meta: {member.metadata_privacy} - setPrivacyView(false)}>Exit setPrivacyMode(true)}>Edit + setPrivacyView(false)}>Exit setprivacyEdit(true)}>Edit
: "" } - { proxyMode ? + { proxyEdit ? <>
Editing proxy tags
@@ -385,11 +389,11 @@ export default function MemberCard(props) { { proxyTags.length === 0 ? No proxy tags set. : proxyTags.map((proxytag, index) => {proxytag.prefix}text{proxytag.suffix} )} - setProxyView(false)}>Exit setProxyMode(true)}>Edit + setProxyView(false)}>Exit setproxyEdit(true)}>Edit
: "" }

Description:

{ localStorage.getItem('twemoji') ?

:

} - { proxyView ? "" : privacyMode ? "" : privacyView ? "" : <> setEditMode(true)}>Edit View page } + { proxyView ? "" : privacyEdit ? "" : privacyView ? "" : <> setEditMode(true)}>Edit View page } } ) } diff --git a/src/Components/Private/MemberPage.js b/src/Components/Private/MemberPage.js index 0c2a1908..1a939961 100644 --- a/src/Components/Private/MemberPage.js +++ b/src/Components/Private/MemberPage.js @@ -23,6 +23,7 @@ export default function MemberPage(props) { const [ displayName, setDisplayName ] = useState(""); const [ birthday, setBirthday ] = useState(""); const [ birthdate, setBirthdate ] = useState(""); + const [ created, setCreated ] = useState(""); const [ pronouns, setPronouns ] = useState(""); const [ editPronouns, setEditPronouns ] = useState(""); const [ avatar, setAvatar ] = useState(""); @@ -88,6 +89,10 @@ export default function MemberPage(props) { setBirthdate(''); } + var createdmoment = moment(member.created).format('MMM D, YYYY'); + setCreated(createdmoment); + + if (member.pronouns) { setPronouns(toHTML(member.pronouns)); setEditPronouns(member.pronouns); @@ -110,7 +115,7 @@ export default function MemberPage(props) { } else { setDesc("(no description)"); setEditDesc(""); } - }, [member.description, member.color, member.birthday, member.display_name, member.pronouns, member.avatar_url, member.proxy_tags]); + }, [member.description, member.color, member.birthday, member.display_name, member.pronouns, member.avatar_url, member.proxy_tags, member.created]); const submitEdit = data => { props.edit(Object.assign(member, data)); @@ -315,7 +320,7 @@ export default function MemberPage(props) { { member.color ? Color: {color} : "" } { privacyView ? "" : proxyView ? "" : Privacy: setPrivacyView(true)}>View } { privacyView ? "" : proxyView ? "" : Proxy tags: setProxyView(true)}>View } - + Created: {created} { privacyMode ?