mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
styling sidebar
This commit is contained in:
parent
f030b5ae1f
commit
3e8ecdf0d8
@ -3,7 +3,6 @@ import { setProfileImage, setProfileData, getProfileImageUrl, getAccountStatus,
|
||||
|
||||
async function updateAccount(token, updateData) {
|
||||
let status = await getAccountStatus(token);
|
||||
console.log(status);
|
||||
updateData({ status: status });
|
||||
}
|
||||
|
||||
@ -112,18 +111,18 @@ export function useAppContext() {
|
||||
while(revision.current != null) {
|
||||
let rev = revision.current;
|
||||
|
||||
// update group if revision changed
|
||||
if (rev.group != groupRevision.current) {
|
||||
await updateGroups(token, groupRevision.current, groups.current, updateData);
|
||||
groupRevision.current = rev.group
|
||||
}
|
||||
|
||||
// update profile if revision changed
|
||||
if (rev.profile != profileRevision.current) {
|
||||
await updateProfile(token, updateData)
|
||||
profileRevision.current = rev.profile
|
||||
}
|
||||
|
||||
// update group if revision changed
|
||||
if (rev.group != groupRevision.current) {
|
||||
await updateGroups(token, groupRevision.current, groups.current, updateData);
|
||||
groupRevision.current = rev.group
|
||||
}
|
||||
|
||||
// update account status if revision changed
|
||||
if (rev.account != accountRevision.current) {
|
||||
await updateAccount(token, updateData)
|
||||
|
@ -96,10 +96,10 @@ export function Profile(props) {
|
||||
<Checkbox checked={state.searchable} onChange={(e) => onSearchable(e.target.checked)} />
|
||||
</div>
|
||||
<div class="avatar" onClick={() => setLogoVisible(true)}>
|
||||
<Logo />
|
||||
<div class="logoedit">
|
||||
<EditIcon />
|
||||
</div>
|
||||
<Logo />
|
||||
</div>
|
||||
<div class="block" onClick={() => setInfoVisible(true)}>
|
||||
<span class="label">details:</span>
|
||||
|
@ -95,13 +95,15 @@ export const ProfileWrapper = styled.div`
|
||||
.logoedit {
|
||||
align-self: flex-end;
|
||||
font-size: 16px;
|
||||
position: absolute;
|
||||
position: relative;
|
||||
padding-right: 8px;
|
||||
cursor: pointer;
|
||||
background: #f6f5ed;
|
||||
padding-left: 8px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #dddddd;
|
||||
z-index: 10;
|
||||
left: 192px;
|
||||
}
|
||||
|
||||
.detailedit {
|
||||
|
@ -79,10 +79,10 @@ export function useProfile() {
|
||||
img.onload = () => {
|
||||
var canvas = document.createElement("canvas");
|
||||
var context = canvas.getContext('2d');
|
||||
canvas.width = 256;
|
||||
canvas.height = 256;
|
||||
canvas.width = 128;
|
||||
canvas.height = 128;
|
||||
context.drawImage(img, state.crop.x, state.crop.y, state.crop.w, state.crop.h,
|
||||
0, 0, 256, 256);
|
||||
0, 0, 128, 128);
|
||||
resolve(canvas.toDataURL());
|
||||
}
|
||||
img.onerror = reject;
|
||||
|
@ -6,7 +6,7 @@ export function Registry() {
|
||||
return (
|
||||
<RegistryWrapper>
|
||||
<Input.Search placeholder="Server" allowClear style={{ width: '100%' }} />
|
||||
|
||||
<div class="contacts" />
|
||||
</RegistryWrapper>
|
||||
);
|
||||
}
|
||||
|
@ -2,10 +2,19 @@ import styled from 'styled-components';
|
||||
|
||||
export const RegistryWrapper = styled.div`
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
text-align: center;
|
||||
height: calc(100vh - 143px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.contacts {
|
||||
flex-grow: 1
|
||||
background-color: #fefefe;
|
||||
border-radius-bottom-right: 8px;
|
||||
border-radius-bottom-left: 8px;
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user