update menu icons

This commit is contained in:
Martti Malmi 2023-04-17 16:56:20 +03:00
parent db1da4e51d
commit b555b6c09d
5 changed files with 51 additions and 46 deletions

View File

@ -1,17 +1,14 @@
export default {
post: (
<svg width="24" viewBox="0 0 700 700" fill="currentColor">
<svg width="24" viewBox="0 0 512 512" fill="currentColor">
<g>
<path d="m116.67 536.67h420c6.1875 0 12.121-2.4609 16.496-6.8359 4.3789-4.375 6.8359-10.309 6.8359-16.5v-233.33c0-8.3359-4.4492-16.039-11.668-20.207s-16.113-4.168-23.332 0-11.668 11.871-11.668 20.207v210h-373.33v-373.33h210c8.3359 0 16.039-4.4492 20.207-11.668s4.168-16.113 0-23.332-11.871-11.668-20.207-11.668h-233.33c-6.1914 0-12.125 2.457-16.5 6.8359-4.375 4.375-6.8359 10.309-6.8359 16.496v420c0 6.1914 2.4609 12.125 6.8359 16.5s10.309 6.8359 16.5 6.8359z" />
<path d="m326.67 217.77v62.23c0 6.1875 2.457 12.125 6.832 16.5s10.312 6.832 16.5 6.832h62.207c6.1875 0 12.121-2.4609 16.496-6.8359l171.12-171.1c4.3828-4.3789 6.8438-10.316 6.8438-16.508 0-6.1953-2.4609-12.133-6.8438-16.512l-62.227-62.203c-4.3789-4.375-10.312-6.832-16.5-6.832-6.1836 0-12.121 2.457-16.496 6.832l-171.1 171.1c-4.375 4.375-6.8359 10.309-6.8359 16.496zm46.668 9.6836 147.77-147.79 29.238 29.238-147.8 147.77h-29.215z" />
<path d="M473.818,0.003c0,0-18.578,28.297-139.938,70.172c-123.719,42.688-199.875,216.406-199.875,216.406 c-18.344,35.578-90.813,183.453-90.813,183.453c-19.953,38.172,16.625,60.734,38.063,21.313 c41.156-75.703,67.688-144.875,130.25-146.844c91.219-2.875,153.609-84.109,133.984-80.359 c-25.844,11.484-82.781,0.875-49.234-4.391c80.531-6.594,130.125-68.297,113.969-72.5c-28.563,11.219-55.172,0.578-60.391-2.656 C491.959,166.987,473.818,0.003,473.818,0.003z"></path>
</g>
</svg>
),
feed: (
<svg width="32" viewBox="0 0 24 24" fill="none">
<g stroke-width="0"></g>
<g stroke-linecap="round" stroke-linejoin="round"></g>
<g>
<path d="M5 12H18" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path>
<path d="M5 17H11" stroke="currentColor" stroke-width="2" stroke-linecap="round"></path>
@ -58,7 +55,6 @@ l1.2-2.4c0.1-0.2,0-0.5-0.2-0.6c-2.3-1.6-3.7-4-3.7-6.5c0-4.7,4.7-8.5,10.4-8.5S22.
settings: (
<svg
version="1.1"
x="0px"
y="0px"
width="25px"
@ -127,20 +123,16 @@ l1.2-2.4c0.1-0.2,0-0.5-0.2-0.6c-2.3-1.6-3.7-4-3.7-6.5c0-4.7,4.7-8.5,10.4-8.5S22.
chat: (
<svg
x="0px"
y="0px"
viewBox="0 0 486.736 486.736"
style="enable-background:new 0 0 486.736 486.736;"
width="24px"
height="24px"
width="24"
fill="currentColor"
stroke="#000000"
stroke-width="0"
viewBox="0 0 32 32"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill="currentColor"
d="M481.883,61.238l-474.3,171.4c-8.8,3.2-10.3,15-2.6,20.2l70.9,48.4l321.8-169.7l-272.4,203.4v82.4c0,5.6,6.3,9,11,5.9 l60-39.8l59.1,40.3c5.4,3.7,12.8,2.1,16.3-3.5l214.5-353.7C487.983,63.638,485.083,60.038,481.883,61.238z"
/>
<g>
<title>envelope</title>
<path d="M28 3.75h-24c-1.794 0.002-3.248 1.456-3.25 3.25v18c0.002 1.794 1.456 3.248 3.25 3.25h24c1.794-0.001 3.249-1.456 3.25-3.25v-18c-0.002-1.794-1.456-3.248-3.25-3.25h-0zM4 6.25h24c0.219 0.001 0.415 0.097 0.549 0.248l0.001 0.001-12.55 8.964-12.55-8.964c0.135-0.152 0.331-0.248 0.549-0.249h0zM28 25.75h-24c-0.414-0-0.75-0.336-0.75-0.75v-15.571l12.023 8.588c0.031 0.018 0.069 0.037 0.108 0.054l0.008 0.003c0.031 0.018 0.068 0.037 0.107 0.054l0.008 0.003c0.145 0.070 0.315 0.113 0.494 0.118l0.002 0h0.002c0.181-0.005 0.351-0.048 0.503-0.121l-0.008 0.003c0.046-0.020 0.084-0.039 0.12-0.060l-0.006 0.003c0.047-0.020 0.085-0.040 0.121-0.061l-0.006 0.003 12.023-8.588v15.571c-0 0.414-0.336 0.75-0.75 0.75v0z"></path>{' '}
</g>
</svg>
),

View File

@ -173,6 +173,7 @@ class Main extends Component<Props, ReactState> {
<Settings path="/settings/:page?" />
<LogoutConfirmation path="/logout" />
<Explorer path="/explorer/:path?" />
<Explorer path="/explorer/:path+" />
<EditProfile path="/profile/edit" />
<MyProfile path="/profile/:id+" tab="profile" />
<MyProfile path="/replies/:id+" tab="replies" />

View File

@ -17,7 +17,7 @@ import QrCode from './QrCode';
const APPLICATIONS = [
// TODO: move editable shortcuts to localState gun
{ url: '/', text: 'feeds', icon: Icons.feed },
{ url: '/', text: 'feeds', icon: Icons.home },
{ url: '/chat', text: 'messages', icon: Icons.chat },
{ url: '/settings', text: 'settings', icon: Icons.settings },
{ url: '/about', text: 'about', icon: Icons.info },

View File

@ -173,18 +173,6 @@ export class Path {
return listener
}
list(path: string, callback: PathCallback, filter = {}): Listener {
filter = Object.assign({}, filter, this.filter, { '#d': [path], kinds: [EVENT_KIND] })
const listener = this.addListener(filter, callback)
this.store.get(filter, (event) => this.callbackFromEvent(event, callback))
this.subscribe([filter], async (event) => {
if (this.store.set(event)) {
this.notifyListeners(event as CompleteEvent)
}
})
return listener
}
addListener(filter: Filter, callback: PathCallback): Listener {
const id = Math.random().toString(36).substr(2, 9)
const listener: Listener = { filter, callback, off: () => {

View File

@ -1,9 +1,31 @@
import { useEffect, useState } from 'preact/hooks';
import styled from 'styled-components';
import Header from '../../components/Header';
import Session from '../../nostr/Session';
import { translate as t } from '../../translations/Translation';
const Row = styled.div`
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 10px 0;
&:nth-child(odd) {
background-color: var(--zebra-stripe-bg);
}
`;
const Column = styled.div`
flex: 1;
padding: 0 10px;
&:first-of-type {
flex: none;
}
`;
const Node = ({ path }) => {
const [value, setValue] = useState(undefined);
@ -12,37 +34,39 @@ const Node = ({ path }) => {
return () => listener?.off();
});
if (Array.isArray(value)) {
if (typeof value === 'object' && value !== null) {
return (
<div class="node">
<div class="node__name">{path}</div>
<div class="node__value">
{value.map((v, i) => (
<Node path={`${path}/${i}`} />
<Row>
<Column>{path}</Column>
<Column>
{Object.keys(value).map((k) => (
<Node path={`${path}/${k}`} />
))}
</div>
</div>
</Column>
</Row>
);
}
return (
<div class="node">
<div class="node__name">{path}</div>
<div class="node__value">{value}</div>
</div>
<Row class="node">
<Column>{path}</Column>
<Column>{JSON.stringify(value)}</Column>
</Row>
);
};
export default function ({ path }) {
path = path || '';
path = path || '/';
return (
<>
<Header />
<div class="main-view" id="settings">
<div class="centered-container">
<h2>{t('explorer')}</h2>
<h2>
{t('explorer')} {path}
</h2>
<div class="explorer">
<Node path={'notifications/lastOpened'} />
<Node path={path} />
</div>
</div>
</div>