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

tweak discover styles & update swftc customer service link #3693

Merged
merged 2 commits into from
Oct 23, 2023
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

import { chunk, debounce } from 'lodash';

import { Box, Stack, useIsVerticalLayout } from '@onekeyhq/components';
import { Box, Stack, VStack, useIsVerticalLayout } from '@onekeyhq/components';

import type { LayoutChangeEvent } from 'react-native';

Expand Down Expand Up @@ -71,7 +71,6 @@ export const DappItemPlainLayout: FC = ({ children }) => {
minW={`${Min}px`}
maxW={`${Max}px`}
width={width ? `${width}px` : undefined}
mb={width ? '4' : undefined}
>
{children}
</Box>
Expand Down Expand Up @@ -131,13 +130,13 @@ const DappItemPlainContainerDynamicLayout: FC<
}
const data = chunk(Children.toArray(children), state.num);
return (
<Box>
<Stack direction="column" space="4">
{data.map((o, index) => (
<Stack key={index} direction="row" space={space} w="full">
{o}
</Stack>
))}
</Box>
</Stack>
);
}, [state, space, children]);
return (
Expand Down
11 changes: 9 additions & 2 deletions packages/kit/src/views/Discover/Home/Desktop/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import {
Input,
Pressable,
Typography,
useTheme,
} from '@onekeyhq/components';
import PNG from '@onekeyhq/kit/assets/discover/header_bg.png';
import PNGLight from '@onekeyhq/kit/assets/discover/header_bg_light.png';

import { gotoSite, openMatchDApp } from '../../Explorer/Controller/gotoSite';
import SearchView from '../../Explorer/Search/SearchView';
Expand Down Expand Up @@ -143,6 +145,7 @@ const SearchInput: FC = () => {

export const Header = () => {
const intl = useIntl();
const { isLight } = useTheme();
return (
<Box pb="8" px="4">
<Box
Expand All @@ -152,9 +155,13 @@ export const Header = () => {
overflow="hidden"
position="relative"
>
<Image source={PNG} w="full" h="full" />
<Image source={isLight ? PNGLight : PNG} w="full" h="full" />
<Center position="absolute" w="full" h="full">
<Typography.PageHeading color="#fff" fontSize={36} lineHeight={50}>
<Typography.PageHeading
color="text-default"
fontSize={36}
lineHeight={50}
>
{intl.formatMessage({ id: 'title__discover_dapps' })}
</Typography.PageHeading>
<Box w="4/5" mt="6">
Expand Down
4 changes: 3 additions & 1 deletion packages/kit/src/views/Discover/Home/Desktop/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useRef } from 'react';
import { useCallback, useMemo, useRef } from 'react';

import type { ForwardRefHandle } from '@onekeyhq/app/src/views/NestedTabView/NestedTabView';
import { Box } from '@onekeyhq/components';
Expand All @@ -17,6 +17,7 @@ export const Desktop = () => {
const onScroll = useCallback(() => {
discoverUIEventBus.emit('scroll');
}, []);
const containerStyle = useMemo(() => ({ flex: 1 }), []);
return (
<Box
flex="1"
Expand All @@ -33,6 +34,7 @@ export const Desktop = () => {
headerView={<Header />}
ref={ref}
onScroll={onScroll}
containerStyle={containerStyle}
>
{tabConfig.map((tab) => (
<Tabs.Tab key={tab.name} name={tab.name} label={tab.label}>
Expand Down
7 changes: 4 additions & 3 deletions packages/kit/src/views/Discover/Home/TabFeatured/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Box,
Icon,
Pressable,
Stack,
Typography,
useIsVerticalLayout,
} from '@onekeyhq/components';
Expand Down Expand Up @@ -111,7 +112,7 @@ const HorizontalContent: FC<ContentProps> = ({ data }) => {
return null;
}
return (
<Box pb="4">
<Box>
<Box px="4">
<ContentHeader title={data.label} id={data.id} />
</Box>
Expand Down Expand Up @@ -214,15 +215,15 @@ const SectionFeaturedContent = () => {
return (
<Box w="full" pb="2">
<BannerContent />
<Box>
<Stack direction="column" space="2">
{groupDapps.map((item, index) =>
index % 2 === 0 ? (
<VerticalContent key={item.label} data={item} />
) : (
<HorizontalContent key={item.label} data={item} />
),
)}
</Box>
</Stack>
<TagContent />
</Box>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/views/Swap/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Token } from '../../store/typings';
import type { Provider } from './typings';

export const swftcCustomerSupportUrl =
'https://www.bangwo8.com/osp2016/im/pc/index.php?vendorID=782460&uid=&customSource=onekey';
'https://tawk.to/chat/6520bf666fcfe87d54b751ef/1hc3unaha';

export const zeroXenabledNetworkIds: string[] = [
OnekeyNetwork.eth,
Expand Down