mirror of
https://github.com/urbit/shrub.git
synced 2025-01-04 10:32:34 +03:00
Merge pull request #4569 from urbit/lf/dark-sigils
Sigils: fix default background
This commit is contained in:
commit
ba24935192
@ -246,7 +246,10 @@ export const MessageAuthor = ({
|
|||||||
scrollWindow,
|
scrollWindow,
|
||||||
...rest
|
...rest
|
||||||
}) => {
|
}) => {
|
||||||
const dark = useLocalState((state) => state.dark);
|
const osDark = useLocalState((state) => state.dark);
|
||||||
|
|
||||||
|
const theme = useSettingsState(s => s.display.theme);
|
||||||
|
const dark = theme === 'dark' || (theme === 'auto' && osDark)
|
||||||
|
|
||||||
const datestamp = moment
|
const datestamp = moment
|
||||||
.unix(msg['time-sent'] / 1000)
|
.unix(msg['time-sent'] / 1000)
|
||||||
|
@ -8,6 +8,7 @@ import { Group } from '@urbit/api';
|
|||||||
|
|
||||||
import { uxToHex, cite, useShowNickname, deSig } from '~/logic/lib/util';
|
import { uxToHex, cite, useShowNickname, deSig } from '~/logic/lib/util';
|
||||||
import useSettingsState, {selectCalmState} from "~/logic/state/settings";
|
import useSettingsState, {selectCalmState} from "~/logic/state/settings";
|
||||||
|
import useLocalState from "~/logic/state/local";
|
||||||
import OverlaySigil from './OverlaySigil';
|
import OverlaySigil from './OverlaySigil';
|
||||||
import { Sigil } from '~/logic/lib/sigil';
|
import { Sigil } from '~/logic/lib/sigil';
|
||||||
import GlobalApi from '~/logic/api/global';
|
import GlobalApi from '~/logic/api/global';
|
||||||
@ -28,11 +29,16 @@ interface AuthorProps {
|
|||||||
export default function Author(props: AuthorProps): ReactElement {
|
export default function Author(props: AuthorProps): ReactElement {
|
||||||
const { contacts, ship = '', date, showImage, group } = props;
|
const { contacts, ship = '', date, showImage, group } = props;
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
const osDark = useLocalState((state) => state.dark);
|
||||||
|
|
||||||
|
const theme = useSettingsState(s => s.display.theme);
|
||||||
|
const dark = theme === 'dark' || (theme === 'auto' && osDark)
|
||||||
|
|
||||||
let contact;
|
let contact;
|
||||||
if (contacts) {
|
if (contacts) {
|
||||||
contact = `~${deSig(ship)}` in contacts ? contacts[`~${deSig(ship)}`] : null;
|
contact = `~${deSig(ship)}` in contacts ? contacts[`~${deSig(ship)}`] : null;
|
||||||
}
|
}
|
||||||
const color = contact?.color ? `#${uxToHex(contact?.color)}` : '#000000';
|
const color = contact?.color ? `#${uxToHex(contact?.color)}` : dark ? '#000000' : '#FFFFFF';
|
||||||
const showNickname = useShowNickname(contact);
|
const showNickname = useShowNickname(contact);
|
||||||
const { hideAvatars } = useSettingsState(selectCalmState);
|
const { hideAvatars } = useSettingsState(selectCalmState);
|
||||||
const name = showNickname ? contact.nickname : cite(ship);
|
const name = showNickname ? contact.nickname : cite(ship);
|
||||||
|
Loading…
Reference in New Issue
Block a user