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

Commit

Permalink
chore: updated quill buttons and the package itself
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-deriv committed Nov 13, 2023
1 parent 9c638a3 commit 59a140c
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 211 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 { ScreenProvider, 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>
<ScreenProvider>
<ThemeProvider theme="light">
<Component {...pageProps} />
</ThemeProvider>
</ScreenProvider>
</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';
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
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
67 changes: 27 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,16 @@ 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,
FluidContainer,
SocialAppleButton,
SocialGoogleButton,
Text,
TextField,
useScreen,
} from '@deriv/quill-design';

export const heroItems: { key: string; image: ReactNode }[] = [
{
Expand Down Expand Up @@ -69,46 +73,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 59a140c

Please sign in to comment.