Skip to content

Commit

Permalink
Revert "Feature/autoclose profile (#413)"
Browse files Browse the repository at this point in the history
This reverts commit 2c97d45.
  • Loading branch information
YHhaoareyou authored Oct 27, 2022
1 parent 2c97d45 commit 0a8d8ab
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 190 deletions.
Binary file removed root/src/assets/img/partners/kredit.png
Binary file not shown.
2 changes: 1 addition & 1 deletion root/src/components/aboutUs/AboutUs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import styled from "styled-components";

import JoinUs from "@app/components/aboutUs/JoinUs";
import OurMission from "@app/components/aboutUs/OurMission";
import Partners from "@app/components/aboutUs/PartnersPage/Partners";
import Partners from "@app/components/aboutUs/Partners";
import { gaAppendActionWithLng, gaChangeLanguage } from "@app/ga/eventActions";
import { gaLanguage } from "@app/ga/eventCategories";
import { ThemeContext } from "@app/utils/theme-context";
Expand Down
14 changes: 2 additions & 12 deletions root/src/components/aboutUs/MeetOurTeam/MeetOurTeam.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useEffect, useState } from "react";
import React from "react";

import { Wrapper } from "@bit/wasedatime.core.ts.styles.wrapper";
import { useTranslation } from "react-i18next";
import styled from "styled-components";

import {
CurrentList,
AlumniList,
CurrentList,
} from "@app/components/aboutUs/MeetOurTeam/memberList";

import { ProfileCard } from "@app/components/block/ProfileCard";
Expand All @@ -33,11 +33,6 @@ const CardArea = styled("div")`

const MeetOurTeam = () => {
const { t } = useTranslation();
const [activeCardName, setActiveCardName] = useState("");

useEffect(() => {
console.log(activeCardName);
}, [activeCardName]);

return (
<Wrapper>
Expand All @@ -55,9 +50,6 @@ const MeetOurTeam = () => {
positions={member.positions}
socials={member.socials}
profileText={member.profileText}
isOpen={activeCardName !== "" && member.name === activeCardName}
onClick={() => setActiveCardName(member.name)}
onClose={() => setActiveCardName("")}
/>
))}
</CardArea>
Expand All @@ -73,8 +65,6 @@ const MeetOurTeam = () => {
positions={member.positions}
socials={member.socials}
profileText={member.profileText}
onClick={() => setActiveCardName(member.name)}
isOpen={member.name === activeCardName}
/>
))}
</CardArea>
Expand Down
2 changes: 0 additions & 2 deletions root/src/components/aboutUs/MeetOurTeam/memberList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export interface Members {
positions: Array<string>;
socials?: Array<{ platform: string; link: string }>;
profileText?: string;
isOpen?: boolean;
onClick?: () => void;
}

export const CurrentList: Array<Members> = [
Expand Down
102 changes: 0 additions & 102 deletions root/src/components/aboutUs/PartnersPage/PartnerList.ts

This file was deleted.

59 changes: 0 additions & 59 deletions root/src/components/aboutUs/PartnersPage/Partners.tsx

This file was deleted.

23 changes: 9 additions & 14 deletions root/src/components/block/ProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ const MediaIcon = styled("img")`
export interface ProfileCardProps {
image: string;
name: string;
positions?: Array<string>;
positions: Array<string>;
socials?: Array<{ platform: string; link: string }>;
profileText?: string;
onClick?: () => void;
onClose?: () => void;
isOpen?: boolean;
// mini?: boolean;
}

Expand All @@ -41,24 +38,23 @@ export const ProfileCard = ({
positions,
socials,
profileText,
onClick,
onClose,
isOpen,
}: // mini,
ProfileCardProps) => {
const [showCard, setShowCard] = useState<boolean>(false);

const handleClick = () => {
setShowCard(!showCard);
};

return (
<Card
className="block group cursor-pointer transition ease-in-out delay-300ms transition-duration:1500ms md:mx-8 md:my-6 lg:mx-10 lg:my-8"

onClick={handleClick}
>
{isOpen ? (
<div className="card w-auto card-side rounded-8xl bg-gradient-to-r from-light-card2 to-light-card1 dark:bg-gradient-to-r dark:from-dark-card2 dark:to-dark-bgMain drop-shadow-lg translate-x-[5px] transition ease-in-out delay-200ms transition-duration:3000ms my-[9px] sm:my-[16px] z-20">
{showCard ? (
<div
// Card: pic + hidden card-body + Name
className="card w-auto card-side rounded-8xl bg-gradient-to-r from-light-card2 to-light-card1 dark:bg-gradient-to-r dark:from-dark-card2 dark:to-dark-bgMain drop-shadow-lg translate-x-[5px] transition ease-in-out delay-200ms transition-duration:3000ms my-[9px] sm:my-[16px] z-20"
>
{/* Profile pic */}
<figure className="px-3 py-3 sm:px-5 sm:py-5">
{/* responsive for smaller screen: w/h - [100px] */}
Expand All @@ -70,7 +66,7 @@ ProfileCardProps) => {
{/* Card Body */}
<div className="card-body items-left text-left w-[200px] sm:w-[260px] block opacity-100 p-[10px] sm:p-[20px]">
{/* close button from daisyui */}
<div className="card-actions justify-end" onClick={onClose}>
<div className="card-actions justify-end">
<button className="btn btn-square btn-sm border-transparent hover:border-transparent bg-light-card1 hover:bg-light-card2 focus:bg-light-card3 dark:bg-transparent dark:hover:bg-dark-card1 dark:focus:bg-dark-card2">
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -126,8 +122,7 @@ ProfileCardProps) => {
</div>
</div>
) : (
// Card: pic + hidden card-body + Name
<div onClick={onClick}>
<div>
<div>
<p className="text-center text-lg sm:text-xl text-transparent font-bold group-hover:text-light-text2 dark:group-hover:text-dark-text1 translate-y-[85px] sm:translate-y-[110px] z-10">
Click to view the profile!
Expand Down

0 comments on commit 0a8d8ab

Please sign in to comment.