Skip to content

Commit

Permalink
Merge pull request #186 from datagrove/next-release
Browse files Browse the repository at this point in the history
Update to Next release
  • Loading branch information
r-southworth authored Nov 25, 2024
2 parents c03e4d4 + 14ecfd4 commit d156298
Show file tree
Hide file tree
Showing 23 changed files with 796 additions and 225 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
version: latest

- run: supabase link --project-ref $SUPABASE_PROJECT_ID
- run: supabase db push
- run: supabase db push
2 changes: 2 additions & 0 deletions src/assets/person-svgrepo-com.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/components/common/notices/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const Banner: Component<BannerProps> = (props) => {
target="_blank"
>
<div class="relative flex w-full bg-btn1 text-center text-btn1Text dark:bg-btn1-DM dark:text-btn1Text-DM">
<div class="prose mx-auto line-clamp-2 max-w-[calc(100vw-4rem)]">
<div class="prose mx-auto line-clamp-2 max-w-[calc(100vw-4rem)] text-ptext2 dark:text-ptext2-DM">
{props.content}
</div>
<button
Expand All @@ -103,13 +103,13 @@ const Banner: Component<BannerProps> = (props) => {
</a>
</Show>
<Show when={!props.linkLocation}>
<div class="w-full bg-btn1 text-center text-btn1Text dark:bg-btn1-DM dark:text-btn1Text-DM">
<div class="prose mx-auto line-clamp-2 max-w-[calc(100vw-4rem)]">
<div class="flex w-full bg-btn1 text-center text-btn1Text dark:bg-btn1-DM dark:text-btn1Text-DM">
<div class="prose mx-auto line-clamp-2 max-w-[calc(100vw-4rem)] text-ptext2 dark:text-ptext2-DM">
{props.content}
</div>
<button
aria-label="Close Banner"
class="banner__close text-xl"
class="banner__close pr-4 text-xl"
onClick={(e) => closeBanner(e)}
>
&times;
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/notices/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const Modal: Component<ModalProps> = (props) => {
/>
<section
role="dialog"
class="modal min-h-100vh w-100vw md:min-h-auto fixed inset-0 z-[60] overflow-y-auto bg-background1 p-4 dark:bg-background1-DM md:left-1/2 md:top-1/2 md:max-h-[calc(100vh-4rem)] md:w-[calc(100vw-4rem)] md:max-w-[768px] md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-xl"
class="modal min-h-100vh w-100vw md:min-h-auto fixed inset-0 z-[60] overflow-y-auto overflow-x-hidden bg-background1 p-4 dark:bg-background1-DM md:left-1/2 md:top-1/2 md:max-h-[calc(100vh-4rem)] md:w-[calc(100vw-4rem)] md:max-w-[768px] md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-xl"
ref={setModal}
>
<header class="sticky flex flex-row flex-nowrap items-center justify-between gap-[2rem] border-b-[1px]">
Expand Down
55 changes: 55 additions & 0 deletions src/components/members/UserProfileView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { UserProfileViewMobile } from "@components/members/UserProfileViewMobile
import { useStore } from "@nanostores/solid";
import { windowSize } from "@components/common/WindowSizeStore";
import { ViewUserFavorites } from "@components/posts/ViewUserFavorites";
import Banner from "@components/common/notices/Banner";
import Modal from "@components/common/notices/modal";

const lang = getLangFromUrl(new URL(window.location.href));
const t = useTranslations(lang);
Expand Down Expand Up @@ -204,6 +206,59 @@ export const UserProfileView: Component = () => {

return (
<div class="">
<div class="mb-4">
<Banner
content={
<Modal
buttonClass=""
buttonId="scavenger2"
buttonContent={t("huntModal.buttonContent")}
buttonAriaLabel={t("huntModal.buttonAria")}
heading={t("huntModal.stop2")}
headingLevel={3}
>
<>
<div class="flex justify-center text-lg font-bold">
🥳 {t("huntModal.solvedClue2")} 🥳
</div>
<div class="text-center text-lg italic">
{t("huntModal.solveAll")}
</div>
<br />
<div class="text-center font-bold">
{t("huntModal.discountCode")}:{" "}
</div>
<div class="text-center text-2xl font-bold text-htext1 dark:text-htext1-DM">
PROFILE20
</div>
<br />
<div class="text-center font-bold">
{t("huntModal.nextClue")}
</div>
<Show
when={lang == "en"}
fallback={t("huntModal.clue2Lang")}
>
<div class="flex justify-center text-center italic leading-loose">
On LearnGrove’s site, where ideas grow,
<br />
Share what you've crafted, let others
know.
<br />
For learners seeking something new,
<br />
Your knowledge here can guide them
through!
<br />
</div>
</Show>
</>
</Modal>
}
startDate="2024-11-17"
endDate="2024-12-31"
/>
</div>
<div class="text-center text-xl font-bold italic text-alert1 dark:text-alert1-DM">
<Show when={editMode() === true}>
<h1 class="text-alert1 dark:text-alert1-DM">
Expand Down
37 changes: 24 additions & 13 deletions src/components/posts/AverageRatingStars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,17 @@ export const AverageRatingStars: Component<Props> = (props) => {
});

return (
<div>
<Show when={props.page === "home" || props.page === "mobileFullDetails" || props.page === "viewCard"}>
<div class="">
<Show
when={
props.page === "home" ||
props.page === "mobileFullDetails" ||
props.page === "viewCard"
}
>
<div class="flex items-center justify-start">
<svg
id="star1"
id="star1AverageRatings"
fill="none"
width="16px"
height="16px"
Expand Down Expand Up @@ -107,7 +113,7 @@ export const AverageRatingStars: Component<Props> = (props) => {
}
>
<svg
id="star1"
id="star1overall"
fill="none"
width="20px"
height="20px"
Expand All @@ -120,11 +126,12 @@ export const AverageRatingStars: Component<Props> = (props) => {

<Show
when={
(averageRating() >= 1 && averageRating() < 2) ||
(averageRating() >= 2 && averageRating() < 3) ||
(averageRating() >= 3 && averageRating() < 4) ||
(averageRating() >= 4 && averageRating() < 5) ||
averageRating() === 5
averageRating() >= 2
// (averageRating() >= 1 && averageRating() < 2) ||
// (averageRating() >= 2 && averageRating() < 3) ||
// (averageRating() >= 3 && averageRating() < 4) ||
// (averageRating() >= 4 && averageRating() < 5) ||
// averageRating() === 5
}
fallback={
<div>
Expand All @@ -141,7 +148,7 @@ export const AverageRatingStars: Component<Props> = (props) => {
}
>
<svg
id="star2"
id="star2Average"
fill="none"
width="20px"
height="20px"
Expand Down Expand Up @@ -242,9 +249,13 @@ export const AverageRatingStars: Component<Props> = (props) => {
<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>
</Show>
<div class="flex ml-1">
<p class="mr-1 text-xs md:text-lg font-bold">{averageRating()}</p>
<p class="text-xs md:text-lg font-light">({totalRatings()}) {t("postLabels.reviews")}</p>
<div class="ml-1 flex">
<p class="mr-1 text-xs font-bold md:text-lg">
{averageRating()}
</p>
<p class="text-xs font-light md:text-lg">
({totalRatings()}) {t("postLabels.reviews")}
</p>
</div>
</div>
</Show>
Expand Down
40 changes: 40 additions & 0 deletions src/components/posts/CreateEditPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { UploadFiles } from "@components/posts/UploadResource";
import tinymce from "tinymce";
import { sortResourceTypes } from "@lib/utils/resourceSort";
import type { Post } from "@lib/types";
import Banner from "@components/common/notices/Banner";
import Modal from "@components/common/notices/modal";

const lang = getLangFromUrl(new URL(window.location.href));
const t = useTranslations(lang);
Expand Down Expand Up @@ -1028,6 +1030,44 @@ export const CreateEditPost: Component<Props> = (props) => {

return (
<div class="w-full px-2 md:w-auto md:px-0">
<div class="mb-4">
<Banner
content={
<Modal
buttonClass=""
buttonId="scavenger3"
buttonContent={t("huntModal.buttonContentDiscount")}
buttonAriaLabel={t("huntModal.buttonAriaDiscount")}
heading={t("huntModal.stop3")}
headingLevel={3}
>
<>
<div class="flex justify-center text-lg font-bold">
🏅 {t("huntModal.stop3")} 🏅
</div>
<div class="flex flex-col pt-4 text-center text-lg italic">
<p>{t("huntModal.postToWin1")}</p>
<p>{t("huntModal.postToWin2")}</p>
<p>{t("huntModal.postToWin3")}</p>
</div>
<br />
<div class="text-center font-bold">
{t("huntModal.discountCode")}:{" "}
</div>
<div class="text-center text-2xl font-bold text-htext1 dark:text-htext1-DM">
SHAREYOURRESOURCE25
</div>
<br />
<div class="text-center font-bold">
{t("huntModal.thanks")}
</div>
</>
</Modal>
}
startDate="2024-11-17"
endDate="2024-12-31"
/>
</div>
<form onSubmit={submit}>
<div class="text-center text-xs">
<span class="text-alert1">* </span>
Expand Down
Loading

0 comments on commit d156298

Please sign in to comment.