Skip to content

Commit

Permalink
adds UserID to Settings (readonly) and found a better yellow
Browse files Browse the repository at this point in the history
  • Loading branch information
RingoRohe committed May 6, 2020
1 parent 4686c65 commit fa88a20
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/assets/scss/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@import '@fortawesome/fontawesome-free/scss/fontawesome.scss';
@import '@fortawesome/fontawesome-free/scss/solid.scss';
@import '@fortawesome/fontawesome-free/scss/brands.scss';
@import '@fortawesome/fontawesome-free/scss/regular.scss';

* {
outline: none;
Expand Down
3 changes: 1 addition & 2 deletions src/assets/scss/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ $lighter: rgb(241, 238, 233);
$highlight: rgba(235, 94, 40, 1);

$brown: rgb(110, 72, 0);
$yellow: rgb(195, 192, 0);
// TODO: Find a better yellow!!
$yellow: rgb(255, 251, 32);
20 changes: 20 additions & 0 deletions src/pages/settings/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ const Settings = props => {
});
}

const copyText = (e) => {
/* Get the text field */
var copyText = e.target;

/* Select the text field */
copyText.select();
copyText.setSelectionRange(0, 99999); /*For mobile devices*/

/* Copy the text inside the text field */
document.execCommand("copy");

toast.success('copied to clipboard');
}

// TODO: add managable List of Delegate Users
return props.currentUser ? (
<section className="page_settings">
<article className="card child_name">
Expand All @@ -76,6 +91,11 @@ const Settings = props => {
inline
/>
</article>
<article className="card userid">
<span className="card_icon far fa-copy fa-3x"></span>
<h2>your UserID</h2>
<input type="text" value={props.currentUser.realUid} readOnly onClick={copyText} />
</article>
<article className="card nopadding save">
<button onClick={saveSettings}>Save Settings</button>
</article>
Expand Down
21 changes: 21 additions & 0 deletions src/pages/settings/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
}

.child_birthday {
grid-row: 2 / span 2;

&>div {
text-align: center;

Expand All @@ -61,6 +63,25 @@
}
}

.userid {
input {
display: block;
min-height: 3rem;
width: 100%;
height: 80%;
text-align: center;
font-size: 1rem;
margin: 0;
padding: 0;
border: 0;
cursor: pointer;

@media (max-width: $breakpoints_m) {
font-size: .8rem;
}
}
}

.save {
button {
width: 100%;
Expand Down

0 comments on commit fa88a20

Please sign in to comment.