Skip to content

Commit

Permalink
fix: add theme compatible part2
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJiang2021 authored and kity-bundle committed Sep 27, 2023
1 parent 82b8852 commit f942af5
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion apps/storefront/src/components/extraTip/CheckoutTip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function CheckoutTip(props: CheckoutTipProps) {
!isAgenting && (
<Dialog
sx={{
zIndex: 110000,
zIndex: 99999999993,
padding: '40px 40px 20px 40px',
}}
open={open}
Expand Down
2 changes: 1 addition & 1 deletion apps/storefront/src/components/loadding/Loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Loading({ backColor }: LoadingProps) {
top: 0,
left: 0,
backgroundColor: backColor || 'background.default',
zIndex: 120000,
zIndex: 99999999995,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function B3HoverButton(props: B3HoverButtonProps) {
return (
<Snackbar
sx={{
zIndex: '110000',
zIndex: '99999999993',
width: 'auto',
...positionStyles,
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export default function B3MasquradeGobalTip(props: B3MasquradeGobalTipProps) {
{!isOpen && isMobile && (
<Snackbar
sx={{
zIndex: '110000',
zIndex: '99999999993',
...getPosition(horizontalPadding, verticalPadding, location),
}}
anchorOrigin={getLocation(location) || defaultLocation}
Expand All @@ -190,7 +190,7 @@ export default function B3MasquradeGobalTip(props: B3MasquradeGobalTipProps) {
{!isOpen && !isMobile && (
<Snackbar
sx={{
zIndex: '110000',
zIndex: '9999999999',
borderRadius: '4px',
height: '52px',
fontSize: '16px',
Expand Down Expand Up @@ -276,7 +276,7 @@ export default function B3MasquradeGobalTip(props: B3MasquradeGobalTipProps) {
{isOpen && !isMobile && (
<Snackbar
sx={{
zIndex: '110000',
zIndex: '9999999999',
borderRadius: '4px',
height: '52px',
...customStyles,
Expand Down Expand Up @@ -359,7 +359,7 @@ export default function B3MasquradeGobalTip(props: B3MasquradeGobalTipProps) {
{isOpen && isMobile && (
<Snackbar
sx={{
zIndex: '110000',
zIndex: '9999999999',
borderRadius: '4px',
height: '52px',
...sx,
Expand Down
2 changes: 1 addition & 1 deletion apps/storefront/src/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ input[type='number']::-webkit-outer-spin-button {
top: 0;
left: 0;
background-color: #fef9f5;
z-index: 120000;
z-index: 99999999995;
display: flex;
justify-content: center;
align-items: center;
Expand Down
5 changes: 3 additions & 2 deletions packages/global-b3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const themeOtherElementConfig = () => {
// Camden: '[href="/account.php"] svg, [href="/account.php"] svg use, [href="/account.php"] span, [href="/account.php"], [href="/login.php"] span, [href="/login.php"] svg use, [href="/login.php"] svg, [href="/login.php"]'
// Vault: '.navUser-item--account a, .navUser-item--account a svg',
// Fortune: '[href="/login.php?action=create_account"]',
// Pinnacle: Theme Pinnacle and NextGen are compatible with the theme LifeStyle;; Artisan、CoventGarden、 Artify and HaloOne: method compatible
// Pinnacle: Theme Pinnacle and NextGen are compatible with the theme LifeStyle;; Artisan、CoventGarden、 Artify: method compatible
const themeElements: ThemeElementsProps = {
Hera: '[href^="/account.php"] span, .account-item .account-action span svg, .account-item .account-action span svg use, [href^="/login.php?action=logout"], [href="/login.php"] .icon, .account-item .account-action span',
RightRope:
Expand All @@ -35,7 +35,8 @@ const themeOtherElementConfig = () => {
LifeStyle:
'.navUser-item--account a, .navUser-item--account a svg, .navUser-section-sub .navUser-item .needsclick, .navUser-section-sub .navUser-item .needsclick svg, .navUser-section-sub .navUser-item .needsclick span, .navUser-section-sub .navUser-item a, .navUser-section-sub .navUser-item a svg, .navUser-section-sub .navUser-item a svg use, .navUser-section-sub .navUser-item a span',
Chiara:
'.navUser-item--more, #navUser-more-toggle, #navUser-more-toggle a, #navUser-more-toggle .navUser-item-icon, #navUser-more-toggle .navUser-item-icon svg, #navUser-more-toggle .navUser-item-icon svg use, #navUser-more-toggle .navUser-item-moreLabel',
'.navUser-item--more, #navUser-more-toggle, #navUser-more-toggle .navUser-item-icon, #navUser-more-toggle .navUser-item-icon svg, #navUser-more-toggle .navUser-item-icon svg use, #navUser-more-toggle .navUser-item-moreLabel, .header-top-item--login, .header-top-item--login .header-top-action, .header-top-item--logout, .header-top-item--logout [href^="/login.php?action=logout"]',
HaloOne: '[href^="/account.php"] svg, [href^="/account.php"] svg path',
}

if (window?.B3CustomConfig) {
Expand Down
10 changes: 6 additions & 4 deletions packages/hooks/useB3AppOpen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ export const useB3AppOpen = (initOpenState: OpenPageState) => {
}
}
}
const B3Role = sessionStorage.getItem('sf-B3Role') || ''

const RoleInfo = sessionStorage.getItem('sf-B3Role')
const B3Role = RoleInfo ? JSON.parse(RoleInfo || '') : ''
const isLogin = B3Role === '' ? false : JSON.parse(B3Role) !== 100
const hrefArr = href.split('/#')
if (hrefArr[1] === '' && isLogin) {
return false
if (hrefArr[1] === '') {
href = isLogin ? '/orders' : '/login'
}

if (isLogin && href.includes('/login')) {
if (isLogin && href === '/login.php') {
href = '/orders'
}
if (initOpenState?.handleEnterClick) {
Expand Down

0 comments on commit f942af5

Please sign in to comment.