basic styles
parent
fd180cca7a
commit
d7addbb496
|
|
@ -38,6 +38,15 @@ export default function App() {
|
||||||
--red: #ff5555;
|
--red: #ff5555;
|
||||||
--yellow: #f1fa8c;
|
--yellow: #f1fa8c;
|
||||||
--primary: var(--purple);
|
--primary: var(--purple);
|
||||||
|
--neutral-1: #191a21;
|
||||||
|
--neutral-2: #21222c;
|
||||||
|
--neutral-3: #282a36;
|
||||||
|
--neutral-4: #343746;
|
||||||
|
--neutral-5: #44475a;
|
||||||
|
--neutral-6: #717380;
|
||||||
|
--neutral-7: #9ea0a6;
|
||||||
|
--neutral-8: #cbcccc;
|
||||||
|
--neutral-9: #f8f8f2;
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
color: var(--cyan);
|
color: var(--cyan);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export function ColorTest() {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div style={{
|
||||||
|
display: 'grid',
|
||||||
|
gridTemplateColumns: 'repeat(9, 1fr)'
|
||||||
|
}}>
|
||||||
|
{[1, 2, 3, 4, 5, 6, 7, 8, 9].map(n => (
|
||||||
|
<div key={n} style={{
|
||||||
|
background: `var(--neutral-${n})`,
|
||||||
|
width: '100%',
|
||||||
|
height: '32px',
|
||||||
|
display: 'inline-block'
|
||||||
|
}}></div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style={{
|
||||||
|
display: 'grid',
|
||||||
|
gridTemplateColumns: 'repeat(7, 1fr)'
|
||||||
|
}}>
|
||||||
|
{['green','orange','cyan','pink','purple','red','yellow'].map((c) => (
|
||||||
|
<div key={c} style={{
|
||||||
|
backgroundColor: `var(--${c})`,
|
||||||
|
width: '100%',
|
||||||
|
height: '32px',
|
||||||
|
display: 'inline-block'
|
||||||
|
}}></div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -22,8 +22,8 @@ export default function Channel(props: ChannelProps) {
|
||||||
gridTemplateColumns: 'min-content 1fr',
|
gridTemplateColumns: 'min-content 1fr',
|
||||||
color: selected ? 'cyan' : 'inherit',
|
color: selected ? 'cyan' : 'inherit',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
background: selected ? 'var(--current-line)' :
|
background: selected ? 'var(--neutral-4)' :
|
||||||
hover ? 'rgba(255, 255, 255, 0.1)' :
|
hover ? 'var(--neutral-3)' :
|
||||||
'inherit',
|
'inherit',
|
||||||
borderRadius: '8px',
|
borderRadius: '8px',
|
||||||
// placeItems: 'left center',
|
// placeItems: 'left center',
|
||||||
|
|
@ -35,18 +35,17 @@ export default function Channel(props: ChannelProps) {
|
||||||
ref={ref}
|
ref={ref}
|
||||||
>
|
>
|
||||||
<CgHashtag color={
|
<CgHashtag color={
|
||||||
selected ? 'var(--foreground)' :
|
selected ? 'var(--neutral-9)' :
|
||||||
hover ? 'var(--comment)' :
|
hover ? 'var(--neutral-7)' :
|
||||||
'var(--current-line)'
|
'var(--neutral-7)'
|
||||||
} size={24} style={{
|
} size={24} style={{
|
||||||
fontWeight: 'bold',
|
|
||||||
margin: '4px',
|
margin: '4px',
|
||||||
}}></CgHashtag>
|
}}></CgHashtag>
|
||||||
<div style={{
|
<div style={{
|
||||||
lineHeight: '32px',
|
lineHeight: '32px',
|
||||||
color: selected ? 'var(--foreground)' :
|
color: selected ? 'var(--neutral-9)' :
|
||||||
hover ? 'var(--comment)' :
|
hover ? 'var(--neutral-9)' :
|
||||||
'var(--current-line)'
|
'var(--neutral-7)'
|
||||||
}}>
|
}}>
|
||||||
{name.toLowerCase().replaceAll(' ', '-').trim()}
|
{name.toLowerCase().replaceAll(' ', '-').trim()}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
import { useCallback, useContext, useEffect, useRef, useState } from 'react';
|
import {
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useRef,
|
||||||
|
useState
|
||||||
|
} from 'react';
|
||||||
import { useApi } from '../lib/useApi';
|
import { useApi } from '../lib/useApi';
|
||||||
import type { IMessage } from './Message';
|
import type { IMessage } from './Message';
|
||||||
import NameTextbox from './NameTextbox';
|
|
||||||
import LoginQR from './LoginQR';
|
|
||||||
import Totp from '../components/Totp';
|
|
||||||
import useChannel from '../hooks/useChannel';
|
import useChannel from '../hooks/useChannel';
|
||||||
import useClientId from '../hooks/useClientId';
|
import useClientId from '../hooks/useClientId';
|
||||||
import useHomeServer from '../contexts/PersistentState/useHomeServerNative';
|
import useHomeServer from '../contexts/PersistentState/useHomeServerNative';
|
||||||
import Logout from '../components/Logout';
|
|
||||||
import { CgHashtag } from 'react-icons/cg';
|
|
||||||
import Channel from './Channel';
|
import Channel from './Channel';
|
||||||
|
|
||||||
interface IChannel {
|
interface IChannel {
|
||||||
|
|
@ -28,8 +28,6 @@ export default function Channels() {
|
||||||
const { channel, setChannel } = useChannel()
|
const { channel, setChannel } = useChannel()
|
||||||
const { clientId } = useClientId()
|
const { clientId } = useClientId()
|
||||||
|
|
||||||
const { setHomeServer } = useHomeServer();
|
|
||||||
|
|
||||||
const { send } = useApi({
|
const { send } = useApi({
|
||||||
'channels:list'(data: IChannel[]) {
|
'channels:list'(data: IChannel[]) {
|
||||||
setChannels(data);
|
setChannels(data);
|
||||||
|
|
@ -89,6 +87,7 @@ export default function Channels() {
|
||||||
<div style={{
|
<div style={{
|
||||||
height: '100%',
|
height: '100%',
|
||||||
background: '#21222c',
|
background: '#21222c',
|
||||||
|
padding: '0px 8px'
|
||||||
}}>
|
}}>
|
||||||
<br></br>
|
<br></br>
|
||||||
{channels.map(c => (
|
{channels.map(c => (
|
||||||
|
|
@ -99,33 +98,6 @@ export default function Channels() {
|
||||||
name={c.name}
|
name={c.name}
|
||||||
></Channel>
|
></Channel>
|
||||||
))}
|
))}
|
||||||
{/* <input
|
|
||||||
ref={textbox}
|
|
||||||
style={{
|
|
||||||
background: '#343746',
|
|
||||||
border: 'none',
|
|
||||||
padding: '8px',
|
|
||||||
borderRadius: '8px',
|
|
||||||
outline: 'none',
|
|
||||||
color: 'white',
|
|
||||||
fontSize: '16px',
|
|
||||||
width: '90px',
|
|
||||||
}}
|
|
||||||
/><button onClick={add} style={{
|
|
||||||
marginLeft: '8px',
|
|
||||||
background: '#bd93f9',
|
|
||||||
border: 'none',
|
|
||||||
color: 'white',
|
|
||||||
padding: '8px',
|
|
||||||
fontSize: '16px',
|
|
||||||
cursor: 'pointer',
|
|
||||||
borderRadius: '8px',
|
|
||||||
// lineHeight: '20px'
|
|
||||||
}}>ADD</button>
|
|
||||||
<NameTextbox></NameTextbox><br></br>
|
|
||||||
<Logout></Logout><br></br> */}
|
|
||||||
{/* <LoginQR></LoginQR> */}
|
|
||||||
{/* <Totp></Totp> */}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in New Issue