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

Production Release #1266

Merged
merged 9 commits into from
Aug 27, 2024
Merged
82 changes: 82 additions & 0 deletions .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build docker

on:
push:
branches:
- develop
- staging
- main

env:
IMAGE_NAME: europe-docker.pkg.dev/jumper-g-artifacts/docker-jumper-exchange/jumpex

jobs:
build-docker:
runs-on: ubuntu-latest

# id token
permissions:
contents: "read"
id-token: "write"

steps:
- # check out the repository
name: Checkout
uses: actions/checkout@v2

- name: Set current date as env variable
run: echo "UNIQ_ID=$(date +'%y%m%d')-${GITHUB_SHA:0:7}" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: |
/tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

- name: Authenticate to Google Cloud
id: gcpauth
uses: google-github-actions/auth@v2
with:
create_credentials_file: 'true'
workload_identity_provider: 'projects/800848389157/locations/global/workloadIdentityPools/github/providers/github'
service_account: '[email protected]'

- # login to gcp
name: login
run: |-
gcloud auth login --brief --cred-file="${{ steps.gcpauth.outputs.credentials_file_path }}"
gcloud auth configure-docker europe-docker.pkg.dev

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=branch,prefix=${{ env.UNIQ_ID }}-

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: |
type=local,src=/tmp/.buildx-cache
cache-to: |
type=local,dest=/tmp/.buildx-cache
build-args: |
ENV_FILE=${{ github.ref_name == 'main' && '.env.production' || github.ref_name == 'develop' && '.env.development' || format('.env.{0}', github.ref_name) }}
ENV_NAME=${{ github.ref_name == 'main' && 'prod' || github.ref_name }}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getContrastAlphaColor } from '@/utils/colors';
import type { Breakpoint } from '@mui/material';
import { Box, Typography, styled } from '@mui/material';
import { Box, Typography, alpha, styled } from '@mui/material';
import { IconButtonTertiary } from 'src/components/IconButton.style';

export const InstructionsAccordionItemContainer = styled(Box)(({ theme }) => ({
Expand Down Expand Up @@ -77,6 +77,12 @@ export const InstructionsAccordionToggle = styled(IconButtonTertiary)(

export const InstructionsAccordionItemLabel = styled(Box)(({ theme }) => ({
marginLeft: theme.spacing(2),
color: alpha(
theme.palette.mode === 'light'
? theme.palette.black.main
: theme.palette.white.main,
0.75,
),
fontWeight: 600,
fontSize: '18px',
lineHeight: '32px',
Expand Down
17 changes: 15 additions & 2 deletions src/components/Blog/CustomRichBlocks.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,24 @@ interface BlogParagraphProps extends TypographyProps {
underline?: boolean;
strikethrough?: boolean;
italic?: boolean;
quote?: boolean;
}

export const BlogParagraph = styled(Typography, {
shouldForwardProp: (prop) =>
prop !== 'bold' &&
prop !== 'underline' &&
prop !== 'italic' &&
prop !== 'strikethrough',
})<BlogParagraphProps>(({ theme, bold, underline, strikethrough, italic }) => {
prop !== 'strikethrough' &&
prop !== 'quote',
})<BlogParagraphProps>(({
theme,
bold,
underline,
strikethrough,
italic,
quote,
}) => {
const textDecoration = underline
? 'underline'
: strikethrough
Expand All @@ -36,6 +45,10 @@ export const BlogParagraph = styled(Typography, {
fontSize: '18px',
lineHeight: '32px',
margin: theme.spacing(2, 0),
...(quote && {
fontSize: '20px',
fontStyle: 'italic',
}),
};
});

Expand Down
43 changes: 41 additions & 2 deletions src/components/Blog/CustomRichBlocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,30 @@ interface WidgetRouteSettings
toChain?: string;
}

interface ParagraphProps {
text: string;
bold?: boolean;
italic?: boolean;
underline?: boolean;
strikethrough?: boolean;
[key: string]: any;
}

interface QuoteProps {
text: string;
[key: string]: any;
}

interface RichElement<T> {
key: string | null;
props: T;
ref: any;
[key: string]: any;
}

type ParagraphElement = RichElement<ParagraphProps>;
type QuoteElement = RichElement<QuoteProps>;

export const CustomRichBlocks = ({
id,
baseUrl,
Expand All @@ -56,6 +80,7 @@ export const CustomRichBlocks = ({
baseUrl ? (
<Lightbox imageData={data.image} baseUrl={baseUrl} />
) : undefined,

heading: ({
children,
level,
Expand Down Expand Up @@ -102,7 +127,21 @@ export const CustomRichBlocks = ({
);
}
},
paragraph: ({ children }: any) => {

quote: ({ children }: { children: QuoteElement[] }) => {
return children.map((quote) => {
return (
<BlogParagraphContainer key={generateKey('quote')}>
<BlogParagraph quote={true} as="q">
{quote.props.text}
</BlogParagraph>
</BlogParagraphContainer>
);
});
},

paragraph: ({ children }: ParagraphElement) => {
console.log('PARAGRAPH', children);
if (children[0].props.text.includes('<JUMPER_CTA')) {
try {
const htmlString = children[0].props.text;
Expand Down Expand Up @@ -188,7 +227,7 @@ export const CustomRichBlocks = ({
} else {
return (
<BlogParagraphContainer>
{children.map((el: any, index: number) => {
{children.map((el: ParagraphElement, index: number) => {
if (el.props.text || el.props.text !== '') {
if (el.props.content?.type === 'link') {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ interface AvailableMissionsListProps {
quests?: Quest[];
pastCampaigns?: string[];
loading: boolean;
isJumperTurtleMember?: boolean;
}

export const AvailableMissionsList = ({
quests,
pastCampaigns,
loading,
isJumperTurtleMember,
}: AvailableMissionsListProps) => {
const isMobile = useMediaQuery((theme: Theme) =>
theme.breakpoints.down('md'),
Expand Down Expand Up @@ -107,6 +109,8 @@ export const AvailableMissionsList = ({
const rewards = quest.attributes.CustomInformation?.['rewards'];
const rewardType =
quest.attributes?.CustomInformation?.['rewardType'];
const missionType =
quest?.attributes?.CustomInformation?.['missionType'];
const rewardRange =
quest.attributes?.CustomInformation?.['rewardRange'];
const chains = quest.attributes.CustomInformation?.['chains'];
Expand Down Expand Up @@ -146,6 +150,13 @@ export const AvailableMissionsList = ({
if (rewardsIds && pastCampaigns) {
completed = checkInclusion(pastCampaigns, rewardsIds);
}
if (
missionType &&
missionType === 'turtle_signature' &&
isJumperTurtleMember
) {
completed = true;
}

return (
<QuestCard
Expand Down
Loading
Loading