Skip to content

Commit

Permalink
fix: mf-5500 adjust icon color of sidebar on minds (#12019)
Browse files Browse the repository at this point in the history
  • Loading branch information
swkatmask authored Jan 5, 2025
1 parent 8113b89 commit 3f612d0
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/icons/brands/MaskBlue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 21 additions & 1 deletion packages/icons/icon-generated-as-jsx.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@ const mindsBreakPoint = 1221 /** px */
const Container = styled('div')`
height: 45px;
margin-bottom: 10px;
padding-left: 10px;
`
const Item = styled(ListItemButton)`
border-radius: 8px;
height: 45px;
padding: 4px 12px 4px 0;
color: ${({ theme }) => theme.palette.primary.main};
color: #43434d !important;
&:hover {
background: unset;
color: rgb(48, 153, 242);
color: #43434d;
}
[data-icon] {
color: #43434d;
--icon-color: #43434d;
}
@media screen and (max-width: ${mindsBreakPoint}px) {
padding: 12px 0;
Expand All @@ -28,12 +33,12 @@ const Text = styled(Typography)`
/* Minds font */
font-family: Roboto, Helvetica, sans-serif;
font-weight: 700;
font-size: 17px;
font-size: 19px;
line-height: 44px;
`
const Icon = styled(ListItemIcon)`
color: inherit;
min-width: 48px;
min-width: 45px;
margin-left: 6px;
@media screen and (max-width: ${mindsBreakPoint}px) {
min-width: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function postEditorInTimelineSelector() {
}

export function toolboxInSidebarSelector() {
return querySelector<E>('.m-sidebarNavigation__list li:nth-child(7)')
return querySelector<E>('.m-sidebarNavigation__list li:has([data-ref="sidenav-wallet"])')
}

export function postEditorDraftContentSelector() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const RedPacket = memo(function RedPacket({ payload }: RedPacketProps) {
)
return isOnTwitter || isOnFacebook ?
_(msg`${claimed} Follow @${shareTextOption.account} (mask.io) to claim lucky drops.`) +
`\npromote_short\n#mask_io #LuckyDrop\n${shareTextOption.payload}`
`\n${promote_short}\n#mask_io #LuckyDrop\n${shareTextOption.payload}`
: `${claimed}\n${promote_short}\n${shareTextOption.payload}`
}
const head = _(
Expand Down
11 changes: 4 additions & 7 deletions packages/theme/src/ShadowRoot/ShadowRootSetup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ObservableMap } from '@masknet/shared-base'
import { StrictMode, useEffect, useState, type JSX } from 'react'
import { StrictMode, useSyncExternalStore, type JSX } from 'react'
import { createRoot } from 'react-dom/client'
import { PreventShadowRootEventPropagationListContext } from './Contexts.js'

Expand Down Expand Up @@ -35,13 +35,10 @@ export function setupReactShadowRootEnvironment(
)
return portalContainer
}
const subscribe = (f: () => void) =>
shadowEnvironmentMountingRoots.event.on(shadowEnvironmentMountingRoots.ALL_EVENTS, f)
function MountingPoint(props: { wrapJSX: WrapJSX; preventPropagationList: Array<keyof HTMLElementEventMap> }) {
const [children, setChildren] = useState<JSX.Element[]>([])
useEffect(() => {
shadowEnvironmentMountingRoots.event.on(shadowEnvironmentMountingRoots.ALL_EVENTS, () => {
setChildren(Array.from(shadowEnvironmentMountingRoots.values()))
})
}, [])
const children = useSyncExternalStore(subscribe, () => shadowEnvironmentMountingRoots.asValues)
return (
<PreventShadowRootEventPropagationListContext value={props.preventPropagationList}>
{props.wrapJSX ? props.wrapJSX(children) : children}
Expand Down

0 comments on commit 3f612d0

Please sign in to comment.