Skip to content

Commit

Permalink
Merge branch 'next-release' into AddAllFavorites
Browse files Browse the repository at this point in the history
  • Loading branch information
r-southworth authored Oct 1, 2024
2 parents 0cabd28 + c37cd66 commit 14014c4
Show file tree
Hide file tree
Showing 52 changed files with 5,836 additions and 1,395 deletions.
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"prettier.printWidth": 250
}
"prettier.printWidth": 250,
"deno.enable": true,
"deno.lint": true,
}
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@lexical/react": "^0.12.2",
"@nanostores/persistent": "^0.9.1",
"@nanostores/solid": "^0.4.2",
"@neodrag/solid": "^2.0.4",
"@playwright/test": "^1.41.2",
"@stripe/stripe-js": "^3.0.6",
"@supabase/supabase-js": "^2.39.6",
Expand Down
8 changes: 4 additions & 4 deletions src/components/common/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ const Dropdown: Component<Props> = (Props: Props) => {
<div class="relative inline-block w-full">
{/* Dropdown button */}
<button
class="flex w-full justify-between rounded border border-inputBorder1 bg-background1 text-ptext1 focus:border-2 focus:border-highlight1 focus:outline-none dark:border-inputBorder1-DM dark:bg-background2-DM dark:text-ptext2-DM dark:focus:border-highlight1-DM"
class="flex w-full items-center justify-between rounded border border-inputBorder1 bg-background1 text-ptext1 focus:border-2 focus:border-highlight1 focus:outline-none dark:border-inputBorder1-DM dark:bg-background2-DM dark:text-ptext2-DM dark:focus:border-highlight1-DM"
onClick={(e) => {
e.preventDefault();
setIsOpen(!isOpen());
}}
>
<div class="ml-1 inline-block">
<div class="ml-1 flex min-h-[44px] items-center overflow-hidden text-lg">
{/* TODO: This should take a prop to define whether it is required or not and what label to use */}
<span class="text-alert1">* </span>
<div class="text-alert1">* </div>
{Props.selectedOption ||
t("formLabels.chooseTaxCode") ||
t("formLabels.dropdownDefault")}
</div>
{/* Dropdown icon */}
<div class="inline-block">
<div class="">
<svg
class={`inline-block h-5 w-5 transform transition-transform dark:fill-white
${isOpen() ? "rotate-180" : ""}`}
Expand Down
2 changes: 2 additions & 0 deletions src/components/common/notices/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type ModalProps = {
buttonContent: JSX.Element;
heading: HeadingProps["heading"];
headingLevel?: HeadingProps["headingLevel"];
classList?: string;
};

const Modal: Component<ModalProps> = (props) => {
Expand Down Expand Up @@ -70,6 +71,7 @@ const Modal: Component<ModalProps> = (props) => {
e.stopPropagation();
setIsOpen(false);
}

return (
<>
<button
Expand Down
5 changes: 4 additions & 1 deletion src/components/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { windowSize } from "@components/common/WindowSizeStore";
import { HomeCard } from "@components/home/HomeCard";
import { HomeGradeCarousel } from "./HomeGradeCarousel";
import { useTranslations } from "../../i18n/utils";
import { debounce } from "@lib/utils/debounce";

// const lang = getLangFromUrl(new URL(window.location.href));

Expand All @@ -15,7 +16,7 @@ interface Props {
subjectCarousel: JSXElement;
}

async function fetchPosts({
async function postRequest({
lang,
draft_status,
listing_status,
Expand All @@ -40,6 +41,8 @@ async function fetchPosts({
return data;
}

const fetchPosts = debounce(postRequest, 500);

export const Home: Component<Props> = (props) => {
const [lang, setLang] = createSignal<"en" | "es" | "fr">(props.lang);
const [popularPosts, setPopularPosts] = createSignal<Array<Post>>([]);
Expand Down
28 changes: 6 additions & 22 deletions src/components/home/HomeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useTranslations } from "../../i18n/utils";
import { lazyLoadImage } from "@lib/imageHelper";
import postPlaceHolder from "@src/assets/postPlaceHolder.svg";
import person from "@src/assets/person.svg";
import { AverageRatingStars } from "@components/posts/AverageRatingStars";

interface Props {
// Define the type for the filterPosts prop
Expand Down Expand Up @@ -164,28 +165,11 @@ export const HomeCard: Component<Props> = (props) => {
id="homeCard-ratings-price"
class="row-span-1 text-end"
>
{/* <div class="flex w-2/3 items-end"> */}
{/* <div class="flex items-end justify-start"> */}
{/* <svg */}
{/* xmlns="http://www.w3.org/2000/svg" */}
{/* width="15px" */}
{/* height="15px" */}
{/* viewBox="0 0 32 32" */}
{/* class="fill-icon1 dark:fill-icon1-DM" */}
{/* > */}
{/* <path d="M 30.335938 12.546875 L 20.164063 11.472656 L 16 2.132813 L 11.835938 11.472656 L 1.664063 12.546875 L 9.261719 19.394531 L 7.140625 29.398438 L 16 24.289063 L 24.859375 29.398438 L 22.738281 19.394531 Z" /> */}
{/* </svg> */}
{/**/}
{/* <p class="ml-1 mr-0.5 text-xs font-bold"> */}
{/* 4.9 */}
{/* </p> */}
{/* <p class="text-xs font-light"> */}
{/* (30.3K) */}
{/* </p> */}
{/* </div> */}
{/* </div> */}

<div class=" text-end">
<div class="my-1 flex justify-between text-end">
<AverageRatingStars
resourceId={post.id}
page={"home"}
/>
<Show when={post.price > 0}>
<p class="text-xs font-bold">
${post.price.toFixed(2)}
Expand Down
5 changes: 3 additions & 2 deletions src/components/home/HomeSubjectCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,13 @@ export const HomeSubjectCarousel: Component<Props> = (props) => {
allCategoryInfo.push({
...categoriesData[i],
...categories.find(
(itmInner) =>
itmInner.id.toString() === categoriesData[i].id
(itmInner) => itmInner.id === categoriesData[i].id
),
});
}

allCategoryInfo.sort((a, b) => a.name.localeCompare(b.name));

setSubjectData(allCategoryInfo);
console.log(allCategoryInfo);
});
Expand Down
5 changes: 4 additions & 1 deletion src/components/members/UserProfileView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export const UserProfileView: Component = () => {
<Show when={screenSize() === "sm"}>
<UserProfileViewMobile
user={user() ? user()! : null}
session={session()}
editMode={editMode()}
enableEditMode={enableEditMode}
userImage={userImage()}
Expand Down Expand Up @@ -487,7 +488,9 @@ export const UserProfileView: Component = () => {
{/* <Show when={ purchasedItems() }> */}
<div>
{/* <ViewCard posts={purchasedItems()} /> */}
<ViewUserPurchases />
<ViewUserPurchases
session={session()}
/>
</div>
{/* </Show>
Expand Down
4 changes: 3 additions & 1 deletion src/components/members/UserProfileViewMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ import type { User } from "@lib/types";
import type { Post } from "@lib/types";
import { ViewUserPurchases } from "@components/posts/ViewUserPurchases";
import { ViewUserFavorites } from "@components/posts/ViewUserFavorites";
import type { AuthSession } from "@supabase/supabase-js";

const lang = getLangFromUrl(new URL(window.location.href));
const t = useTranslations(lang);

interface Props {
user: User | null;
session: AuthSession | null;
userImage: string | undefined;
editMode: boolean;
enableEditMode: () => void;
Expand Down Expand Up @@ -357,7 +359,7 @@ export const UserProfileViewMobile: Component<Props> = (props: Props) => {

<Show when={tabSelected() === "purchases"}>
<div>
<ViewUserPurchases />
<ViewUserPurchases session={props.session} />
</div>
</Show>

Expand Down
Loading

0 comments on commit 14014c4

Please sign in to comment.