Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeparticle committed Sep 22, 2023
1 parent 553639f commit efbde10
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 80 deletions.
7 changes: 6 additions & 1 deletion ui/src/components/General/ListItems/News/News.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ const News: React.FC<ListItemProps<NewsType>> = ({
<Skeleton loading={isLoading}>
<Space size={"middle"} align="start">
{image && (
<Image width={200} preview={false} src={image} alt="" />
<Image
width="10vw"
preview={false}
src={image}
alt=""
/>
)}
<div>
<Title level={4}>{title}</Title>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/About/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { Card, List, Table, Typography } from "antd";
import style from "./About.module.scss";
import about from "assets/about.jpg";
import Footer from "../../components/Layouts/Footer";
import Footer from "components/Layouts/Footer";

const About = () => {
return (
Expand Down
48 changes: 26 additions & 22 deletions ui/src/pages/Feedback/index.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
import { useState } from "react";
import style from "./Feedback.module.scss";
import { Skeleton } from "antd";
import Footer from "components/Layouts/Footer";

const AirtableEmbed = () => {
const [loading, setLoading] = useState(true);

return (
<div className={style.feedback}>
{loading && (
<div className={style.feedback__skeletons}>
<Skeleton active title paragraph={{ rows: 10 }} />
<Skeleton.Input active />
<Skeleton title active />
<Skeleton active paragraph={{ rows: 10 }} />
<Skeleton.Input active />
<Skeleton active paragraph={{ rows: 10 }} />
<Skeleton.Input active />
<Skeleton active paragraph={{ rows: 10 }} />
<Skeleton.Input active />
<Skeleton.Button active />
</div>
)}
<>
<div className={style.feedback}>
{loading && (
<div className={style.feedback__skeletons}>
<Skeleton active title paragraph={{ rows: 10 }} />
<Skeleton.Input active />
<Skeleton title active />
<Skeleton active paragraph={{ rows: 10 }} />
<Skeleton.Input active />
<Skeleton active paragraph={{ rows: 10 }} />
<Skeleton.Input active />
<Skeleton active paragraph={{ rows: 10 }} />
<Skeleton.Input active />
<Skeleton.Button active />
</div>
)}

<iframe
className={`airtable-embed airtable-dynamic-height ${style.iframe}`}
src="https://airtable.com/embed/appbcH1EyjqD8PXkK/shrm5RlUHdworbgSz?backgroundColor=blue"
height="1949.375"
onLoad={() => setLoading(false)}
></iframe>
</div>
<iframe
className={`airtable-embed airtable-dynamic-height ${style.iframe}`}
src="https://airtable.com/embed/appbcH1EyjqD8PXkK/shrm5RlUHdworbgSz?backgroundColor=blue"
height="1949.375"
onLoad={() => setLoading(false)}
></iframe>
</div>
<Footer />
</>
);
};

Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/Home/components/Contribution.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import style from "../Home.module.scss";
import style from "pages/Home/Home.module.scss";
import { Space, Typography } from "antd";
import { ResponsiveButton } from "components/General/FormComponents";

Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/Home/components/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import style from "../Home.module.scss";
import style from "pages/Home/Home.module.scss";
import { Typography } from "antd";
import { FEATURE_DATA } from "pages/About/utils/constants";

Expand Down
48 changes: 0 additions & 48 deletions ui/src/pages/Home/components/Values.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions ui/src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ import Footer from "components/Layouts/Footer";
import Features from "./components/Features";
import Hero from "./components/Hero";
import Contribution from "./components/Contribution";
import Values from "./components/Values";

const Home = () => {
return (
<div className={style.home}>
<div className={style.home__container}>
<Hero />
<Features />
<Values />
<Contribution />
</div>
<Footer />
Expand Down
5 changes: 3 additions & 2 deletions ui/src/pages/Newsfeed/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ const TAB_ITEMS: TabsProps["items"] = [
show: true,
},
].filter((item) => item.show);
const ROOT_URL = import.meta.env.DEV

const BASE_URL = import.meta.env.DEV
? "http://localhost:5000/rss?name="
: "https://binarytree-rssfeed-api.vercel.app/rss?name=";

const QUERY_KEY_NEWS = "news";

export { SITE_OPTIONS, TAB_ITEMS, ROOT_URL, QUERY_KEY_NEWS };
export { SITE_OPTIONS, TAB_ITEMS, BASE_URL, QUERY_KEY_NEWS };
4 changes: 2 additions & 2 deletions ui/src/pages/Newsfeed/utils/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from "react";
import { parseXML } from "./helper";
import { ROOT_URL, SITE_OPTIONS } from "./constants";
import { BASE_URL, SITE_OPTIONS } from "./constants";
import useFetchList from "lib/utils/hooks/useFetchList";

const useNewsFeed = () => {
Expand All @@ -11,7 +11,7 @@ const useNewsFeed = () => {

const { data, isLoading, isError } = useFetchList(
url,
isFeedItem ? `${ROOT_URL}${url}` : url
isFeedItem ? `${BASE_URL}${url}` : url
);
let items = undefined;
if (data) {
Expand Down

0 comments on commit efbde10

Please sign in to comment.