Move files and rename classes.

This commit is contained in:
jamesjulich 2021-09-12 22:25:58 -05:00
parent fcb4104856
commit f97596689f
5 changed files with 22 additions and 21 deletions

View file

@ -3,10 +3,10 @@ import PropTypes from 'prop-types';
import initMatrix from '../../../client/initMatrix'; import initMatrix from '../../../client/initMatrix';
import GenIC from '../../../../public/res/ic/outlined/settings.svg'; import SettingsIC from '../../../../public/res/ic/outlined/settings.svg';
import Avatar from '../avatar/Avatar'; import Avatar from '../../atoms/avatar/Avatar';
import RawIcon from '../system-icons/RawIcon'; import RawIcon from '../../atoms/system-icons/RawIcon';
import './ImageUpload.scss'; import './ImageUpload.scss';
function ImageUpload({ function ImageUpload({
@ -29,8 +29,8 @@ function ImageUpload({
} }
return ( return (
<button type="button" className="img-upload-container" onClick={() => { uploadImageRef.current.click(); }}> <button type="button" className="img-upload" onClick={() => { uploadImageRef.current.click(); }}>
<div className="img-upload-mask"> <div className="img-upload__mask">
<Avatar <Avatar
imageSrc={imageSrc} imageSrc={imageSrc}
text={text.slice(0, 1)} text={text.slice(0, 1)}
@ -38,8 +38,8 @@ function ImageUpload({
size="large" size="large"
/> />
</div> </div>
<div className="img-upload-icon"> <div className="img-upload__icon">
<RawIcon size="small" src={GenIC} /> <RawIcon size="small" src={SettingsIC} />
</div> </div>
<input onChange={uploadImage} style={{ display: 'none' }} ref={uploadImageRef} type="file" /> <input onChange={uploadImage} style={{ display: 'none' }} ref={uploadImageRef} type="file" />
</button> </button>

View file

@ -1,20 +1,20 @@
.img-upload-container { .img-upload {
display: flex; display: flex;
flex-direction: row-reverse; flex-direction: row-reverse;
width: 80px; width: 80px;
height: 80px; height: 80px;
} }
.img-upload-container:hover { .img-upload:hover {
cursor: pointer; cursor: pointer;
} }
.img-upload-mask { .img-upload__mask {
mask: url('../../../../public/res/svg/avatar-clip.svg'); mask: url('../../../../public/res/svg/avatar-clip.svg');
//width: 80px; -webkit-mask: url('../../../../public/res/svg/avatar-clip.svg');
} }
.img-upload-icon { .img-upload__icon {
z-index: 1; z-index: 1;
position: absolute; position: absolute;
} }

View file

@ -5,7 +5,7 @@ import initMatrix from '../../../client/initMatrix';
import colorMXID from '../../../util/colorMXID'; import colorMXID from '../../../util/colorMXID';
import Button from '../../atoms/button/Button'; import Button from '../../atoms/button/Button';
import ImageUpload from '../../atoms/image-upload/ImageUpload'; import ImageUpload from '../../molecules/image-upload/ImageUpload';
import Input from '../../atoms/input/Input'; import Input from '../../atoms/input/Input';
import Text from '../../atoms/text/Text'; import Text from '../../atoms/text/Text';
@ -45,12 +45,12 @@ function ProfileEditor({
return ( return (
<form className="profile-editor"> <form className="profile-editor">
<ImageUpload text={username} bgColor={bgColor} imageSrc={imageSrc} onUpload={handleUpload} /> <ImageUpload text={username} bgColor={bgColor} imageSrc={imageSrc} onUpload={handleUpload} />
<div className="display-name-input-container"> <div className="profile-editor__input-container">
<Text variant="b3"> <Text variant="b3">
Display name of&nbsp; Display name of&nbsp;
{mx.getUserId()} {mx.getUserId()}
</Text> </Text>
<Input id="display-name-input" onChange={onDisplayNameInputChange} placeholder={mx.getUser(mx.getUserId()).displayName} forwardRef={displayNameRef} /> <Input id="profile-editor__input" onChange={onDisplayNameInputChange} placeholder={mx.getUser(mx.getUserId()).displayName} forwardRef={displayNameRef} />
</div> </div>
<Button variant="primary" onClick={saveDisplayName} disabled={disabled}>Save</Button> <Button variant="primary" onClick={saveDisplayName} disabled={disabled}>Save</Button>
</form> </form>

View file

@ -3,11 +3,11 @@
align-items: end; align-items: end;
} }
.img-upload-container { .img-upload {
margin-right: var(--sp-normal) margin-right: var(--sp-normal)
} }
.display-name-input-container { .profile-editor__input-container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-right: var(--sp-normal); margin-right: var(--sp-normal);
@ -15,7 +15,7 @@
max-width: 400px; max-width: 400px;
} }
.display-name-input-container > .text-b3 { .profile-editor__input-container > .text-b3 {
margin-bottom: var(--sp-ultra-tight) margin-bottom: var(--sp-ultra-tight)
} }

View file

@ -14,10 +14,11 @@ import SegmentedControls from '../../atoms/segmented-controls/SegmentedControls'
import PopupWindow, { PWContentSelector } from '../../molecules/popup-window/PopupWindow'; import PopupWindow, { PWContentSelector } from '../../molecules/popup-window/PopupWindow';
import SettingTile from '../../molecules/setting-tile/SettingTile'; import SettingTile from '../../molecules/setting-tile/SettingTile';
import ProfileEditor from '../../molecules/profile-editor/ProfileEditor';
import ImportE2ERoomKeys from '../../molecules/import-e2e-room-keys/ImportE2ERoomKeys'; import ImportE2ERoomKeys from '../../molecules/import-e2e-room-keys/ImportE2ERoomKeys';
import GenIC from '../../../../public/res/ic/outlined/settings.svg'; import ProfileEditor from '../profile-editor/ProfileEditor';
import SettingsIC from '../../../../public/res/ic/outlined/settings.svg';
import SunIC from '../../../../public/res/ic/outlined/sun.svg'; import SunIC from '../../../../public/res/ic/outlined/sun.svg';
import LockIC from '../../../../public/res/ic/outlined/lock.svg'; import LockIC from '../../../../public/res/ic/outlined/lock.svg';
import InfoIC from '../../../../public/res/ic/outlined/info.svg'; import InfoIC from '../../../../public/res/ic/outlined/info.svg';
@ -120,7 +121,7 @@ function AboutSection() {
function Settings({ isOpen, onRequestClose }) { function Settings({ isOpen, onRequestClose }) {
const settingSections = [{ const settingSections = [{
name: 'General', name: 'General',
iconSrc: GenIC, iconSrc: SettingsIC,
render() { render() {
return <GeneralSection />; return <GeneralSection />;
}, },