Skip to content

Commit

Permalink
feat(oracle-landing): tabs/fixes (#1062)
Browse files Browse the repository at this point in the history
  • Loading branch information
happylolonly authored Dec 13, 2023
1 parent 7222b6b commit f7fb6cd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 31 deletions.
4 changes: 0 additions & 4 deletions src/features/cyberlinks/CyberlinksGraph/useCyberlinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ function useCyberlinks(
where = '{}';
}

console.time('prepareCyberlinks');

const query = useQuery(
gql`
query Cyberlinks {
Expand Down Expand Up @@ -72,8 +70,6 @@ function useCyberlinks(
};
}

console.timeEnd('prepareCyberlinks');

return {
nodes: object,
links: links,
Expand Down
10 changes: 6 additions & 4 deletions src/pages/oracle/landing/OracleLanding.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@ $mobile-breakpoint: 480px;
flex-direction: column;
justify-content: space-between;
// header, footer widths, TODO: use variables
min-height: calc(100vh - 120px - 60px - 45px);
min-height: calc(100vh - 120px - 60px - 100px);

padding: 0 10px;

// not good, need fix wrapper
margin-bottom: 100px;
margin-top: -15px;

@media (width <= $mobile-breakpoint) {
// padding: 0 50px;

.actionBarBtn {
min-width: 107px;
}
Expand All @@ -41,6 +38,11 @@ $mobile-breakpoint: 480px;
margin: 0px auto;
width: 415px;

// because of adviser container
position: relative;
top: -45px;
z-index: 5;

@media (width <= $mobile-breakpoint) {
width: unset;

Expand Down
41 changes: 18 additions & 23 deletions src/pages/oracle/landing/OracleLanding.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { ActionBar, Button } from 'src/components';
import { ActionBar, Button, Tabs } from 'src/components';
import { routes } from 'src/routes';
import { useEffect, useMemo, useRef, useState } from 'react';
import { useEffect, useRef, useState } from 'react';
import CyberlinksGraphContainer from 'src/features/cyberlinks/CyberlinksGraph/CyberlinksGraphContainer';
import { Stars } from 'src/containers/portal/components';

import { useDevice } from 'src/contexts/device';

import { useAppDispatch } from 'src/redux/hooks';
import { setFocus } from 'src/containers/application/Header/Commander/commander.redux';
import Carousel from 'src/components/Tabs/Carousel/Carousel';
import { Link, useNavigate, useSearchParams } from 'react-router-dom';
import styles from './OracleLanding.module.scss';
import KeywordButton from './components/KeywordButton/KeywordButton';
Expand Down Expand Up @@ -116,33 +115,29 @@ function OracleLanding() {

const { title, description, text } = listConfig[titleType];

const listSlides = useMemo(() => {
return [TitleType.search, TitleType.ai, TitleType.learning].map((type) => {
return {
title: mapTitleTypeToTitle[type],
// step: type,
};
});
}, []);

return (
<div className={styles.wrapper} ref={ref}>
<div className={styles.starsWrapper}>
<Stars />
</div>

<header className={styles.header}>
<Carousel
color="blue"
noAnimation
activeStep={titleType}
onChange={(index: TitleType) => {
setTitleType(index);
navigate(`?${QUERY_KEY}=${mapTitleTypeToTitle[index]}`, {
replace: true,
});
}}
slides={listSlides}
<Tabs
options={[TitleType.search, TitleType.ai, TitleType.learning].map(
(type) => {
return {
onClick: () => {
setTitleType(type);
// navigate(`?${QUERY_KEY}=${mapTitleTypeToTitle[index]}`, {
// replace: true,
// });
},
text: mapTitleTypeToTitle[type],
key: type,
};
}
)}
selected={titleType}
/>
</header>

Expand Down

0 comments on commit f7fb6cd

Please sign in to comment.