Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📴 Mobile follow up 2 #6457

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/atlas/atlas.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ general:
pioneerMemberUrlPrefix: 'https://dao.joystream.org/#/members' # URL prefix for Pioneer member profile page - used to link to member details
joystreamLandingPageUrl: 'https://www.joystream.org' # URL for Joystream landing page - used in the footer and in "Learn more" links
joystreamDiscordUrl: 'https://discord.gg/DE9UN3YpRP' # URL for Joystream Discord - used for support when errors occur
appContentFocus: 'web3 & crypto' # Content focus of given app. Provide a string, for example `web & crypto` or `sport`
appContentFocus: '' # Content focus of given app. Provide a string, for example `web & crypto` or `sport`
crtMaintenanceMode: false
storage:
assetResponseTimeout: 2_000 # Timeout for asset response in ms - after this timeout, different distributor will be tried
Expand Down
7 changes: 7 additions & 0 deletions packages/atlas/src/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { SentryLogger } from '@/utils/logs'

import { AppLogo } from './components/AppLogo'
import { TopbarBase } from './components/_navigation/TopbarBase'
import { useMountEffect } from './hooks/useMountEffect'
import { useConfirmationModal } from './providers/confirmationModal'
import { useOverlayManager } from './providers/overlayManager'
import { LegalLayout } from './views/legal/LegalLayout'
Expand Down Expand Up @@ -126,5 +127,11 @@ const MiscUtils = () => {
}, parseInt(transitions.timings.routing) + ROUTING_ANIMATION_OFFSET)
}, [location, cachedLocation, locationState, navigationType, clearOverlays])

useMountEffect(() => {
if ('ReactNativeWebView' in window) {
;(window.ReactNativeWebView as { postMessage: (message: string) => void }).postMessage('initialized')
}
})

return null
}
8 changes: 7 additions & 1 deletion packages/atlas/src/components/ChannelTitle/ChannelTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ReactNode } from 'react'
import { SvgActionCreatorToken, SvgActionVerified } from '@/assets/icons'
import { Text, TextVariant } from '@/components/Text'
import { TextBaseProps } from '@/components/Text/Text.styles'
import { cVar } from '@/styles'
import { cVar, media } from '@/styles'

import { FlexBox } from '../FlexBox'

Expand Down Expand Up @@ -35,7 +35,13 @@ export const ChannelTitleText = styled(Text)`
`

const StyledFlexBox = styled(FlexBox)`
justify-content: center;

path {
fill: ${cVar('colorText')};
}

${media.sm} {
justify-content: start;
}
`
8 changes: 5 additions & 3 deletions packages/atlas/src/components/_auth/LogInModal/LogInModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Input } from '@/components/_inputs/Input'
import { DialogModal } from '@/components/_overlays/DialogModal'
import { atlasConfig } from '@/config'
import { useHidePasswordInInput } from '@/hooks/useHidePasswordInInput'
import { useMediaMatch } from '@/hooks/useMediaMatch'
import { useSegmentAnalytics } from '@/hooks/useSegmentAnalytics'
import { useAuth } from '@/providers/auth/auth.hooks'
import { useAuthStore } from '@/providers/auth/auth.store'
Expand All @@ -28,6 +29,7 @@ export const LogInModal = () => {
const { displaySnackbar } = useSnackbar()
const [hidePasswordProps] = useHidePasswordInInput(false)
const { trackPageView } = useSegmentAnalytics()
const smMatch = useMediaMatch('sm')

const setYppModalOpenName = useYppStore((state) => state.actions.setYppModalOpenName)

Expand Down Expand Up @@ -102,12 +104,12 @@ export const LogInModal = () => {
}}
additionalActionsNode={
!isLoading && (
<FlexBox justifyContent="space-between">
<Button variant="tertiary" onClick={() => setAuthModalOpenName(undefined)}>
<FlexBox justifyContent={smMatch ? 'space-between' : undefined}>
<Button variant="tertiary" fullWidth={!smMatch} onClick={() => setAuthModalOpenName(undefined)}>
Close
</Button>

<Button variant="secondary" onClick={() => setAuthModalOpenName('externalLogIn')}>
<Button variant="secondary" fullWidth={!smMatch} onClick={() => setAuthModalOpenName('externalLogIn')}>
Use local wallet
</Button>
</FlexBox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { cVar, sizes } from '@/styles'

export const UnclickableWrapper = styled.div`
cursor: pointer;
width: auto;

> * {
pointer-events: none;
Expand Down
20 changes: 12 additions & 8 deletions packages/atlas/src/components/_inputs/Checkbox/Checkbox.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { css } from '@emotion/react'
import styled from '@emotion/styled'

import { SvgActionCheck } from '@/assets/icons'
import { cVar, sizes, square, zIndex } from '@/styles'
import { cVar, media, sizes, square, zIndex } from '@/styles'

export const Container = styled.div`
position: relative;
Expand Down Expand Up @@ -43,18 +43,22 @@ type CheckboxInputProps = {
error: boolean
}
const hoverCheckedStyles = ({ error }: CheckboxInputProps) => css`
+ ${Checkmark} {
background-color: ${cVar(error ? 'colorBackgroundErrorStrong' : 'colorBackgroundPrimaryStrong')};
${media.sm} {
+ ${Checkmark} {
background-color: ${cVar(error ? 'colorBackgroundErrorStrong' : 'colorBackgroundPrimaryStrong')};

::before {
background-color: ${cVar('colorBackgroundStrongAlpha')};
::before {
background-color: ${cVar('colorBackgroundStrongAlpha')};
}
}
}
`
const hoverUncheckedStyles = css`
+ ${Checkmark} {
::before {
background-color: ${cVar('colorBackgroundStrongAlpha')};
${media.sm} {
+ ${Checkmark} {
::before {
background-color: ${cVar('colorBackgroundStrongAlpha')};
}
}
}
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export const StyledDialog = styled(Dialog)<{ bottomNavOpen: boolean }>`
${({ bottomNavOpen }) => (bottomNavOpen ? transitions.timings.routing : '0ms')};

${media.xs} {
margin-left: 15px;
max-width: calc(100% - 60px);
}

${media.sm} {
max-width: 320px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled from '@emotion/styled'
import { Link } from 'react-router-dom'

import { AssetImage } from '@/components/AssetImage'
import { cVar, square } from '@/styles'
import { cVar, media, square } from '@/styles'

const sharedOverlayStyles = css`
position: absolute;
Expand Down Expand Up @@ -173,77 +173,79 @@ export const VideoThumbnailContainer = styled(Link, { shouldForwardProp: isPropV
background-color: ${cVar('colorBackgroundOverlay')};
}

:hover,
:focus-visible {
${({ clickable }) =>
clickable &&
css`
cursor: pointer;

${HoverOverlay}, ${SlotContainer} {
opacity: 1;
}
`}
${({ clickable, isPlaylist }) =>
!isPlaylist &&
clickable &&
css`
background-color: ${cVar('colorBackgroundPrimary')};

${ContentOverlay}, ${HoverOverlay}, ${SlotsOverlay} {
transform: translate(-8px, -8px);
}
`}
${({ clickable, isPlaylist }) =>
isPlaylist &&
clickable &&
css`
&::before {
${media.sm} {
:hover,
:focus-visible {
${({ clickable }) =>
clickable &&
css`
cursor: pointer;

${HoverOverlay}, ${SlotContainer} {
opacity: 1;
}
`}
${({ clickable, isPlaylist }) =>
!isPlaylist &&
clickable &&
css`
background-color: ${cVar('colorBackgroundPrimary')};
transform: translate(0, 4px);
}

&::after {
background-color: ${cVar('colorBackgroundPrimaryMuted')};
transform: translate(0, 12px);
}

${ContentOverlay}, ${HoverOverlay}, ${PlaylistOverlay}, ${SlotsOverlay} {
transform: translate(0, -4px);
}
${PlaylistOverlay} {
opacity: 0;
}
`}
}

:active {
${({ clickable, isPlaylist, activeDisabled }) =>
clickable &&
!activeDisabled &&
isPlaylist &&
css`
&::before {
transform: translate(0, 4px);
}

&::after {
transform: translate(0, 4px);
}

${ContentOverlay}, ${HoverOverlay}, ${SlotsOverlay} {
transform: translate(0, 4px);
}
`}
${({ clickable, activeDisabled, isPlaylist }) =>
clickable &&
!activeDisabled &&
!isPlaylist &&
css`
${ContentOverlay}, ${HoverOverlay}, ${SlotsOverlay} {
transform: translate(0, 0);
}
`}
${ContentOverlay}, ${HoverOverlay}, ${SlotsOverlay} {
transform: translate(-8px, -8px);
}
`}
${({ clickable, isPlaylist }) =>
isPlaylist &&
clickable &&
css`
&::before {
background-color: ${cVar('colorBackgroundPrimary')};
transform: translate(0, 4px);
}

&::after {
background-color: ${cVar('colorBackgroundPrimaryMuted')};
transform: translate(0, 12px);
}

${ContentOverlay}, ${HoverOverlay}, ${PlaylistOverlay}, ${SlotsOverlay} {
transform: translate(0, -4px);
}
${PlaylistOverlay} {
opacity: 0;
}
`}
}

:active {
${({ clickable, isPlaylist, activeDisabled }) =>
clickable &&
!activeDisabled &&
isPlaylist &&
css`
&::before {
transform: translate(0, 4px);
}

&::after {
transform: translate(0, 4px);
}

${ContentOverlay}, ${HoverOverlay}, ${SlotsOverlay} {
transform: translate(0, 4px);
}
`}
${({ clickable, activeDisabled, isPlaylist }) =>
clickable &&
!activeDisabled &&
!isPlaylist &&
css`
${ContentOverlay}, ${HoverOverlay}, ${SlotsOverlay} {
transform: translate(0, 0);
}
`}
}
}
/* stylelint-enable no-duplicate-selectors */
`
3 changes: 2 additions & 1 deletion packages/atlas/src/providers/snackbars/snackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const SnackbarsContainer = styled.div<{ bottomNavType?: 'action' | 'nav'
margin-left: ${sizes(4)};
display: grid;
z-index: ${zIndex.snackbars};
width: calc(100% - ${sizes(8)});
min-width: calc(100% - ${sizes(8)});
transition: bottom ${cVar('animationTransitionMedium')}
${({ bottomNavType }) => (bottomNavType ? transitions.timings.routing : '0ms')};

Expand All @@ -105,6 +105,7 @@ export const SnackbarsContainer = styled.div<{ bottomNavType?: 'action' | 'nav'
}

${media.sm} {
min-width: 0;
bottom: ${({ bottomNavType }) => sizes(bottomNavType ? 20 : 4)};
}
`
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { css } from '@emotion/react'
import styled from '@emotion/styled'

import { SvgJoyTokenMonochrome16 } from '@/assets/icons'
import { FlexBox } from '@/components/FlexBox'
import { Tabs } from '@/components/Tabs'
import { Text } from '@/components/Text'
import { Button } from '@/components/_buttons/Button'
Expand Down Expand Up @@ -32,6 +33,12 @@ export const TitleSection = styled.div`
}
`

export const FollowButtonWrapper = styled(FlexBox)`
> *:nth-child(1) {
width: 100%;
}
`

export const TitleContainer = styled.div`
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -110,6 +117,7 @@ export const StyledChannelLink = styled(ChannelLink)`
position: relative;
width: fit-content;
justify-self: start;
margin: 0 auto;
border: solid 8px ${cVar('colorCoreBaseBlack')};
border-radius: 100%;
${media.sm} {
Expand Down
6 changes: 3 additions & 3 deletions packages/atlas/src/views/viewer/ChannelView/ChannelView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { SvgActionCheck, SvgActionFilters, SvgActionFlag, SvgActionMore, SvgActi
import { ChannelTitle } from '@/components/ChannelTitle'
import { EmptyFallback } from '@/components/EmptyFallback'
import { FiltersBar, useFiltersBar } from '@/components/FiltersBar'
import { FlexBox } from '@/components/FlexBox'
import { LimitedWidthContainer } from '@/components/LimitedWidthContainer'
import { NumberFormat } from '@/components/NumberFormat'
import { ViewErrorFallback } from '@/components/ViewErrorFallback'
Expand Down Expand Up @@ -43,6 +42,7 @@ import {
ChannelInfoContainer,
CollectorsBoxContainer,
FilterButton,
FollowButtonWrapper,
NotFoundChannelContainer,
StyledButton,
StyledButtonContainer,
Expand Down Expand Up @@ -366,7 +366,7 @@ export const ChannelView: FC = () => {
)}
</StyledButtonContainer>
) : (
<FlexBox width="100%">
<FollowButtonWrapper width="100%">
<ProtectedActionWrapper
title="You want to follow this channel?"
description={`Sign in to follow ${channel?.title}`}
Expand All @@ -391,7 +391,7 @@ export const ChannelView: FC = () => {
]}
trigger={<Button icon={<SvgActionMore />} variant="tertiary" size="large" />}
/>
</FlexBox>
</FollowButtonWrapper>
)}

{channel?.id && (
Expand Down
Loading