Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #151 from deriv-com/michio/update-buttons-with-quill
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-deriv authored Nov 13, 2023
2 parents 9c638a3 + a53610b commit 1838b05
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 214 deletions.
10 changes: 6 additions & 4 deletions apps/deriv-hk/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { AppProps } from 'next/app';
import '../styles.css';
import { ThemeProvider } from '@deriv/quill-design';
import { BreakpointProvider, ThemeProvider } from '@deriv/quill-design';
import { BuildVariantProvider } from '@deriv-com/providers';

function CustomApp({ Component, pageProps }: AppProps) {
return (
<BuildVariantProvider buildVariant="hk">
<ThemeProvider theme="light">
<Component {...pageProps} />
</ThemeProvider>
<BreakpointProvider>
<ThemeProvider theme="light">
<Component {...pageProps} />
</ThemeProvider>
</BreakpointProvider>
</BuildVariantProvider>
);
}
Expand Down
17 changes: 8 additions & 9 deletions libs/blocks/src/lib/search/index.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
import { SearchChip } from '@deriv-com/components';
import { SearchField } from '@deriv/quill-design';
import { ReactNode } from 'react';

export type SearchBlockProps = {
showSearchresults: (e: string) => void;
showSearchResults: (e: string) => void;
content?: ReactNode;
placeholder: string;
onChange: (e: string) => void;
};

export const SearchBlock = ({
showSearchresults,
showSearchResults,
content,
placeholder,
onChange,
}: SearchBlockProps) => {
return (
<section className="flex w-full max-w-[1024px] flex-col gap-general-xl py-general-xl">
<SearchChip
<SearchField
placeholder={placeholder}
onChange={(value) => {
showSearchresults(value);
onChange={(e) => {
showSearchResults(e.target.value);

if (onChange) {
onChange(value);
onChange(e.target.value);
}
}}
className="w-full "
inputClassName="!bg-gradient-slate-110"
className="w-full"
/>
{content && content}
</section>
Expand Down
1 change: 0 additions & 1 deletion libs/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ export * from './lib/optimized-image';
export * from './lib/page-layout';
export * from './lib/link';
export * from './lib/table/account-table';
export * from './lib/search-chip';
export * from './lib/action-sheet/bottom-sheet';
export * from './lib/table-cell';
4 changes: 2 additions & 2 deletions libs/components/src/lib/card/base/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Heading, Text, TextSize, qtMerge } from '@deriv/quill-design';
import { Heading, Text, qtMerge } from '@deriv/quill-design';
import clsx from 'clsx';
import { CardContent } from '../types';
import CustomLink, { textSize } from '../../link';
Expand Down Expand Up @@ -42,7 +42,7 @@ const sizeVariantTextGap = {
lg: 'gap-gap-xl',
};

const textSizeVariant: { [key: string]: TextSize } = {
const textSizeVariant: { [key: string]: 'sm' | 'md' | 'lg' } = {
sm: 'md',
md: 'lg',
lg: 'lg',
Expand Down
18 changes: 12 additions & 6 deletions libs/components/src/lib/card/live-market/buy-sell.buttons.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Text, Button } from '@deriv/quill-design';
import { Text, TradeButton } from '@deriv/quill-design';
import { MarketStatus } from '../types';

export const BuySellButtons = ({
Expand All @@ -19,16 +19,22 @@ export const BuySellButtons = ({
</Text>
</div>
<div className="flex flex-row gap-gap-md">
<Button disabled={status === 'closed'} className="flex-1">
<TradeButton
tradeType="buy"
variant="secondary"
disabled={status === 'closed'}
className="flex-1"
>
Buy
</Button>
<Button
</TradeButton>
<TradeButton
tradeType="sell"
variant="secondary"
disabled={status === 'closed'}
className="flex-1"
colorStyle="black"
>
Sell
</Button>
</TradeButton>
</div>
</div>
);
Expand Down
73 changes: 0 additions & 73 deletions libs/components/src/lib/search-chip/index.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions libs/components/src/lib/search-chip/search-chip.stories.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions libs/components/src/lib/search-chip/search.module.css

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,24 @@ export const MainNavigationButtons = () => {
<Button
variant="secondary"
colorStyle="coral"
size="md"
size="lg"
onClick={onTradersHubClick}
renderLeftIcon={() => (
<StandalonePlaceholderRegularIcon width={12} height={12} />
)}
icon={StandalonePlaceholderRegularIcon}
iconPosition="start"
>
Traders Hub
</Button>
) : (
<>
<Button
variant="secondary"
colorStyle="coral"
size="md"
colorStyle="black"
size="lg"
onClick={onLoginClick}
>
Log in
</Button>
<Button size="md" className="hidden lg:block" onClick={onSignupClick}>
<Button size="lg" className="hidden lg:block" onClick={onSignupClick}>
Create free demo account
</Button>
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CustomLink, CustomLinkProps } from '@deriv-com/components';
import { BodyTypographyProps, Text, qtMerge } from '@deriv/quill-design';
import { Text, qtMerge, BodyTypographyProps } from '@deriv/quill-design';
import { PropsWithChildren, ReactNode } from 'react';

//todo: removed [slugify] from utils/../utils and added here. we need to update this because we are using this on multiple places
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const SearchResults = ({ onSearchKeyChange }: SearchResultsProps) => {
const [results, setResults] = useState<FAQSearchResults[]>([]);
const [searchKey, setSearchKey] = useState('');

const showSearchresults = (query: string) => {
const showSearchResults = (query: string) => {
const finalMatches: FAQSearchResults[] = [];

FAQData.forEach(({ header, questions }) => {
Expand All @@ -37,7 +37,7 @@ export const SearchResults = ({ onSearchKeyChange }: SearchResultsProps) => {
<FluidContainer className="flex w-full flex-col items-center">
<SearchBlock
placeholder='Try "Trade"'
showSearchresults={showSearchresults}
showSearchResults={showSearchResults}
onChange={(e) => setSearchKey(e)}
content={
(results.length || searchKey) && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const TableData: TableContent = {
description:
'Direct market access with fast order execution and no dealing desk intervention.',
cta: (
<Button variant="secondary" className="w-1/2">
<Button variant="secondary" colorStyle="black" size="lg" className="w-1/2">
Get this account
</Button>
),
Expand Down
2 changes: 1 addition & 1 deletion libs/templates/src/lib/home/sections/cta/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const CTABlockContent = () => {
}
>
<Button
colorStyle="black"
colorStyle="coral"
className="lg:mt-general-xl"
size="lg"
onClick={() => scrollTop()}
Expand Down
65 changes: 25 additions & 40 deletions libs/templates/src/lib/home/sections/hero/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import { Swiper, SwiperSlide } from 'swiper/react';
// @ts-ignore
import { Autoplay, EffectFade } from 'swiper';
import { ReactNode } from 'react';
import { Button, FluidContainer, Text } from '@deriv/quill-design';
import {
SocialAppleIcon,
SocialFacebookIcon,
SocialGoogleIcon,
} from '@deriv/quill-icons/Social';
Button,
FacebookSocialButton,
SocialAppleButton,
SocialGoogleButton,
Text,
TextField,
} from '@deriv/quill-design';

export const heroItems: { key: string; image: ReactNode }[] = [
{
Expand Down Expand Up @@ -69,46 +71,29 @@ export const renderHomeHeroSliderContent = () => (

export const HomeHeroForm = () => {
return (
<FluidContainer className={`flex flex-col gap-general-lg pr-general-3xl`}>
<div className="flex flex-col justify-between gap-gap-lg md:flex-row">
<input
placeholder="This component is not styled yet"
className="rounded-2xl border-300 border-solid-red-600"
/>
<div className={'flex flex-col gap-general-lg'}>
<div className="flex flex-col items-center justify-between gap-gap-lg md:flex-row">
<TextField placeholder="Email Address" type="email" />
<Button size="lg" fullWidth>
Create a demo account
Open demo account
</Button>
</div>
<Text>or sign up with</Text>
<div className="flex flex-row items-center justify-between gap-general-sm">
<Button
renderLeftIcon={() => <SocialGoogleIcon iconSize="sm" />}
variant="tertiary"
colorStyle="black"
fullWidth
className="rounded-800 border-75 border-solid-slate-300"
>
Google
</Button>
<Button
renderLeftIcon={() => <SocialFacebookIcon iconSize="sm" />}
variant="tertiary"
colorStyle="black"
fullWidth
className="rounded-800 border-75 border-solid-slate-300"
>
Facebook
</Button>
<Button
renderLeftIcon={() => <SocialAppleIcon iconSize="sm" />}
variant="tertiary"
colorStyle="black"
<div className="flex flex-row items-center justify-between gap-general-sm sm:hidden">
<SocialGoogleButton variant="secondary" fullWidth size="lg" hideLabel />
<FacebookSocialButton
variant="secondary"
fullWidth
className="rounded-800 border-75 border-solid-slate-300"
>
Apple
</Button>
size="lg"
hideLabel
/>
<SocialAppleButton variant="secondary" fullWidth size="lg" hideLabel />
</div>
<div className="hidden flex-row items-center justify-between gap-general-sm sm:flex">
<SocialGoogleButton variant="secondary" fullWidth size="lg" />
<FacebookSocialButton variant="secondary" fullWidth size="lg" />
<SocialAppleButton variant="secondary" fullWidth size="lg" />
</div>
</FluidContainer>
</div>
);
};
Loading

0 comments on commit 1838b05

Please sign in to comment.