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

Release: v5.1.1 #4526

Merged
merged 3 commits into from
Jun 6, 2024
Merged
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
74 changes: 35 additions & 39 deletions src/components/Billboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
BillboardDialog,
BillboardExposureTracker,
Icon,
Spinner,
TextIcon,
} from '~/components'

Expand All @@ -34,7 +33,7 @@ export const Billboard = ({ tokenId, type }: BillboardProps) => {
cacheTime: 60_000,
})

if (!id || isError || !data || !data.contentURI) {
if (!id || isError || isLoading || !data || !data.contentURI) {
return null
}

Expand All @@ -43,43 +42,40 @@ export const Billboard = ({ tokenId, type }: BillboardProps) => {
{({ openDialog: openBillboardDialog }) => {
return (
<div className={styles.billboard}>
{isLoading && <Spinner />}
{!isLoading && (
<>
<a
href={data.redirectURI}
target="_blank"
onClick={() =>
analytics.trackEvent('click_billboard', {
id,
type,
target: data.redirectURI,
})
}
>
<img src={data.contentURI} alt="ad" />
</a>
<button
className={styles.button}
type="button"
aria-label={intl.formatMessage({
defaultMessage: "What's this?",
id: '4wOWfp',
description: 'src/components/Billboard/index.tsx',
})}
onClick={openBillboardDialog}
>
<TextIcon icon={<Icon icon={IconInfo} />} size={12}>
<FormattedMessage
defaultMessage="What's this?"
id="4wOWfp"
description="src/components/Billboard/index.tsx"
/>
</TextIcon>
</button>
<BillboardExposureTracker id={id} type={type} />
</>
)}
<a
href={data.redirectURI}
target="_blank"
onClick={() =>
analytics.trackEvent('click_billboard', {
id,
type,
target: data.redirectURI,
})
}
>
<img src={data.contentURI} alt="ad" />
</a>

<button
className={styles.button}
type="button"
aria-label={intl.formatMessage({
defaultMessage: "What's this?",
id: '4wOWfp',
description: 'src/components/Billboard/index.tsx',
})}
onClick={openBillboardDialog}
>
<TextIcon icon={<Icon icon={IconInfo} />} size={12}>
<FormattedMessage
defaultMessage="What's this?"
id="4wOWfp"
description="src/components/Billboard/index.tsx"
/>
</TextIcon>
</button>

<BillboardExposureTracker id={id} type={type} />
</div>
)
}}
Expand Down
24 changes: 19 additions & 5 deletions src/components/Billboard/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
.billboard {
display: block;
max-width: 21.4375rem;
max-width: 100%;

@media (--sm-up) {
max-width: 50%;
}

@media (--md-up) {
max-width: 100%;
}

& a {
@mixin flex-center-all;

line-height: 0;
position: relative;

&::after {
display: block;
padding-bottom: 56.06%;
content: '';
}

& img {
width: 100%;
max-height: 10.5rem;
@mixin object-fit-cover;

border-radius: 1.25rem;
}
}

& .button {
margin-top: var(--sp8);
color: var(--color-grey);
}
}
2 changes: 1 addition & 1 deletion src/views/Home/Sidebar/Authors/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Authors = () => {
/**
* Data Fetching
*/
const perPage = 5
const perPage = 4
const randomMaxSize = 50
const { data, loading, error, refetch } = usePublicQuery<SidebarAuthorsQuery>(
SIDEBAR_AUTHORS,
Expand Down
2 changes: 1 addition & 1 deletion src/views/Home/Sidebar/Tags/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const Tags = () => {
{ variables: { id: 'local' } }
)
const lastRandom = lastFetchRandom?.lastFetchRandom.sidebarTags // last Random
const perPage = 6
const perPage = 4
const randomMaxSize = 50
const { data, loading, error, refetch } =
usePublicQuery<SidebarTagsPublicQuery>(
Expand Down
9 changes: 3 additions & 6 deletions src/views/Me/History/Comments/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useQuery } from '@apollo/react-hooks'
import _flatten from 'lodash/flatten'
import { useContext } from 'react'
import { useIntl } from 'react-intl'
Expand All @@ -17,7 +18,6 @@ import {
List,
QueryError,
SpinnerBlock,
usePublicQuery,
ViewerContext,
} from '~/components'
import { MeCommentsQuery } from '~/gql/graphql'
Expand Down Expand Up @@ -48,12 +48,9 @@ const Comments = () => {
/**
* Data Fetching
*/
// public data
const { data, loading, error, fetchMore } = usePublicQuery<MeCommentsQuery>(
const { data, loading, error, fetchMore } = useQuery<MeCommentsQuery>(
ME_COMMENTS,
{
variables: { id: viewer?.id },
}
{ variables: { id: viewer?.id } }
)

// pagination
Expand Down
Loading