Skip to content

Commit

Permalink
Merge branch 'main' of github.com:cesium/seium.org into dg/infinite_s…
Browse files Browse the repository at this point in the history
…croll_badgedex
  • Loading branch information
Darguima committed Dec 7, 2023
2 parents 0a4dbc1 + 96c1c7e commit 95dc243
Show file tree
Hide file tree
Showing 82 changed files with 1,018 additions and 548 deletions.
2 changes: 1 addition & 1 deletion components/Badge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function Badge({ name, id, avatar, tokens, owned }: BadgeProps) {
href={`/badge/${id}`}
className={`h-full w-full ${owned ? "opacity-100" : "opacity-30"}`}
>
<div className="flex justify-center items-center w-full aspect-square">
<div className="flex justify-center items-center w-full aspect-square select-none">

{!badgeLoaded && <BadgeSkeleton />}

Expand Down
2 changes: 1 addition & 1 deletion components/BadgeFilter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function BadgeFilter({ onChange }) {
<select
id="location"
name="location"
className="mt-1 block w-full rounded-full border-2 border-quinary bg-white py-2 pl-3 pr-10 text-black ring-quinary focus:border-quinary"
className="mt-1 block w-full select-none rounded-full border-2 border-quinary bg-white py-2 pl-3 pr-10 text-black ring-quinary focus:border-quinary"
defaultValue="All"
onChange={(e) => {
const badge = badgeTypes.find(
Expand Down
4 changes: 3 additions & 1 deletion components/Balance/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export default function Balance({ token_balance, badge_count }) {
return (
<div className="text-white lg:grid lg:grid-cols-3">
<span className="col-span-1 font-ibold text-xl sm:text-2xl">Balance</span>
<span className="col-span-1 select-none font-ibold text-xl sm:text-2xl">
Balance
</span>
<div className="col-span-2 flex gap-x-4 lg:flex-row-reverse">
<span className="text-md font-iregular sm:text-lg">
💰 {token_balance} tokens
Expand Down
41 changes: 25 additions & 16 deletions components/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
import { ButtonHTMLAttributes } from "react";
import { ButtonHTMLAttributes, ReactNode } from "react";

interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
text: string;
customStyle?: string;
interface Props extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "title"> {
title: ReactNode;
description?: string;
bold?: boolean;
}

interface ButtonTitleProps {
title: ReactNode;
bold?: boolean;
}

export default function Button({
text,
type,
disabled,
onClick,
customStyle,
title,
description,
bold = false,
...rest
}: Props) {
return (
<button
onClick={onClick}
type={type}
disabled={disabled}
className={`${
customStyle || ""
} w-full items-center rounded-full border px-4 py-4 text-center font-iregular text-sm shadow-sm`}
{...rest}
className={`m-auto block select-none rounded-full hover:opacity-75 disabled:bg-gray-400 disabled:opacity-75 ${
rest.className || ""
}`}
>
{text}
<ButtonTitle title={title} bold={bold} />
<p className="font-iregular">{description}</p>
</button>
);
}

function ButtonTitle({ title, bold }: ButtonTitleProps) {
const className = bold ? "font-ibold" : "font-iregular";
return <div className={className}>{title}</div>;
}
6 changes: 3 additions & 3 deletions components/Footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default function Footer(props: IFooterProps) {
ref={observe}
>
<div className="flex flex-col justify-between gap-16 py-10 lg:flex-row">
<div className="flex items-start justify-center font-ibold lg:justify-start">
<div className="flex select-none items-start justify-center font-ibold lg:justify-start">
<Image
src="/images/sei-logo.svg"
width={100}
Expand All @@ -101,7 +101,7 @@ export default function Footer(props: IFooterProps) {
</p>
</div>

<div className="mx-2 mt-20 hidden justify-center pb-10 lg:flex">
<div className="mx-2 mt-20 hidden select-none justify-center pb-10 lg:flex">
<Animation
text={
props.footerAnimationText != undefined ? (
Expand All @@ -116,7 +116,7 @@ export default function Footer(props: IFooterProps) {
</div>

<div className="flex-2">
<div className="grid grid-rows-2 justify-items-center gap-8 whitespace-nowrap font-iregular text-sm text-white lg:grid-cols-2 lg:justify-items-start">
<div className="grid select-none grid-rows-2 justify-items-center gap-8 whitespace-nowrap font-iregular text-sm text-white lg:grid-cols-2 lg:justify-items-start">
<Link
href="https://2022.seium.org/"
className="text-white hover:underline"
Expand Down
2 changes: 1 addition & 1 deletion components/Heading/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function Heading({ text, children }: IHeadingProps) {
return (
<div className="border-b-solid mb-5 w-full grid-cols-2 overflow-hidden border-b-2 border-slate-400 pb-3">
<div className="col-span-1 float-left flex h-full font-ibold">
<p className="inline-block align-middle font-ibold text-2xl font-bold text-white">
<p className="inline-block select-none align-middle font-ibold text-2xl font-bold text-white">
{text}
</p>
</div>
Expand Down
98 changes: 60 additions & 38 deletions components/Input/index.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,56 @@
import { forwardRef, InputHTMLAttributes } from "react";

interface Props extends InputHTMLAttributes<HTMLInputElement> {
export interface InputBaseProps
extends Pick<InputHTMLAttributes<HTMLDivElement>, "id" | "children"> {
text: string;
autocomplete?: string;
fgColor: string;
bgColor: string;
enabled?: boolean;
}

export default forwardRef<HTMLInputElement, Props>(function Input(
export interface InputDefaultProps
extends InputBaseProps,
InputHTMLAttributes<HTMLInputElement> {}

// A wrapper to the <input> to standardize styles for the container
export function InputBase({
text,
id,
fgColor,
bgColor,
enabled,
children,
}: InputBaseProps) {
let textColor = `text-${fgColor}`;
let backColor = `bg-${bgColor}`;

return (
<div>
<label
htmlFor={id}
className={`pl-6 font-iregular text-${fgColor} mt-5 block select-none text-sm`}
>
{text}
</label>
<div
className={`text-iregular mt-2 flex items-center ${
enabled == false ? "text-gray-500" : textColor
} ${backColor} appearance-none rounded-full border border-gray-300 px-3 py-2 pl-6 placeholder-gray-400 shadow-sm sm:text-sm`}
>
{children}
</div>
</div>
);
}

export default forwardRef<HTMLInputElement, InputDefaultProps>(function Input(
{
text,
id,
name,
type,
value,
autocomplete,
autoComplete,
fgColor,
bgColor,
onChange,
Expand All @@ -24,40 +59,27 @@ export default forwardRef<HTMLInputElement, Props>(function Input(
},
ref
) {
let textColor = `text-${fgColor}`;
let backColor = `bg-${bgColor}`;

if (enabled === false) {
textColor = "text-gray-500";
backColor = "bg-gray-100";
} else if (enabled === true) {
textColor = `bg-${fgColor}`;
backColor = `bg-${bgColor}`;
}

return (
<div>
<label
htmlFor={id}
className={`pl-6 font-iregular text-${fgColor} mt-5 block text-sm`}
>
{text}
</label>
<div className="mt-2">
<input
id={id}
name={name}
type={type}
autoComplete={autocomplete}
value={value}
required
className={`text-iregular ${textColor} ${backColor} block w-full appearance-none rounded-full border border-gray-300 px-3 py-2 pl-6 placeholder-gray-400 shadow-sm focus:outline-none sm:text-sm`}
onChange={onChange}
disabled={enabled == false}
ref={ref}
{...rest}
/>
</div>
</div>
<InputBase
text={text}
id={id}
fgColor={fgColor}
bgColor={bgColor}
enabled={enabled}
>
<input
id={id}
name={name}
type={type}
autoComplete={autoComplete}
value={value}
required
className="w-full bg-transparent outline-none"
onChange={onChange}
disabled={enabled == false}
ref={ref}
{...rest}
/>
</InputBase>
);
});
2 changes: 1 addition & 1 deletion components/JoinUs/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default function JoinUs(props) {
return (
<a
href="https://sei23.eventbrite.pt"
className={`flex h-28 w-28 flex-shrink-0 rotate-15 transform items-center justify-center font-ibold text-xl text-${props.fgColor} bg-${props.button} translate-x-0 rounded-full`}
className={`flex h-28 w-28 flex-shrink-0 rotate-15 transform items-center justify-center font-ibold text-xl text-${props.fgColor} bg-${props.button} translate-x-0 select-none rounded-full`}
>
Join us 👋
</a>
Expand Down
6 changes: 3 additions & 3 deletions components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function Layout({ title, description, children }: LayoutProps) {
/>

{/* NAVBAR */}
<aside className="inset-y-0 hidden w-72 overflow-y-scroll border-r-2 bg-secondary px-8 py-5 lg:fixed lg:flex lg:flex-col">
<aside className="inset-y-0 hidden w-72 select-none overflow-y-scroll border-r-2 bg-secondary px-8 py-5 lg:fixed lg:flex lg:flex-col">
<div className="flex flex-1">
<nav className="mt-8 flex flex-col">
<Link href="/" className="pb-8">
Expand Down Expand Up @@ -107,7 +107,7 @@ export default function Layout({ title, description, children }: LayoutProps) {

{/* CONTENT */}
<main className="w-full px-4 pb-6 pt-20 lg:ml-72 lg:px-20">
<h2 className="font-ibold text-5xl">{title}</h2>
<h2 className="select-none font-ibold text-5xl">{title}</h2>
<p className="mt-2 font-iregular text-lg">{description}</p>

{children}
Expand Down Expand Up @@ -160,7 +160,7 @@ function MobileNavbar({
leaveTo="-translate-x-full"
className="z-1 absolute h-full w-full justify-between bg-secondary p-8 "
>
<aside className="flex h-full flex-col justify-between">
<aside className="flex h-full select-none flex-col justify-between">
<div>
<div className="flex items-center justify-between">
<Link href="/" className="font-iregular text-quinary">
Expand Down
6 changes: 3 additions & 3 deletions components/Navbar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function Navbar({ bgColor, fgColor, button, children }) {
<div className="relative z-50 flex flex-auto">
<div className="grid w-full grid-cols-4">
<Link href="/">
<div className={`${styles.logo} pt-4 lg:pt-8`}>
<div className={`${styles.logo} select-none pt-4 lg:pt-8`}>
<Image
className="cursor-pointer opacity-60 hover:opacity-100"
src="/images/sei-logo.svg"
Expand All @@ -64,7 +64,7 @@ export default function Navbar({ bgColor, fgColor, button, children }) {
</div>
</Link>
<div className="col-span-3 hidden justify-self-end lg:block">
<div className="flex">
<div className="flex select-none">
<div className="mr-6 grid grid-cols-3 gap-y-4 gap-x-20 pt-4">
{navigation.map((item) => (
<Link
Expand Down Expand Up @@ -160,7 +160,7 @@ export default function Navbar({ bgColor, fgColor, button, children }) {
</div>

<Disclosure.Panel className={`lg:hidden bg-${bgColor}`}>
<div className="relative z-50 min-h-screen object-cover px-2 pt-12">
<div className="relative z-50 min-h-screen select-none object-cover px-2 pt-12">
{navigation.map((item) => (
<Disclosure.Button
key={item.slug}
Expand Down
45 changes: 45 additions & 0 deletions components/PasswordInput/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { forwardRef, useState } from "react";

import { InputBase, InputDefaultProps } from "@components/Input";

import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faEye, faEyeSlash } from "@fortawesome/free-solid-svg-icons";

export default forwardRef<HTMLInputElement, InputDefaultProps>(
function PasswordInput(
{ text, id, name, type, fgColor, bgColor, enabled, ...rest },
ref
) {
const [isPasswordVisible, setIsPasswordVisible] = useState(false);

const togglePasswordVisibility = () => {
setIsPasswordVisible(!isPasswordVisible);
};

return (
<InputBase
text={text}
id={id}
fgColor={fgColor}
bgColor={bgColor}
enabled={enabled}
>
<input
id={id}
name={name}
type={isPasswordVisible ? "text" : "password"}
required
className="w-full bg-transparent outline-none"
disabled={enabled == false}
ref={ref}
{...rest}
/>
<FontAwesomeIcon
className="mx-2 cursor-pointer"
onClick={togglePasswordVisibility}
icon={isPasswordVisible ? faEyeSlash : faEye}
/>
</InputBase>
);
}
);
2 changes: 1 addition & 1 deletion components/QRScanner/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function QRScanner({
</div>
{removeClose !== true && (
<Button
text="Close"
title="Close"
onClick={() => {
setScanner(false);
}}
Expand Down
2 changes: 1 addition & 1 deletion components/Schedule/Day/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function Day(props) {
);

const Ans = () => (
<div className="flex w-full justify-center">
<div className="flex w-full select-none justify-center">
<div className="flex w-full justify-between text-4xl xs:text-5xl sm:text-7xl lg:text-8xl xl:mx-20 xl:text-7xl">
<div className={`${styles.leftArrow} ${styles.arrowWrapper}`}>
<button
Expand Down
5 changes: 3 additions & 2 deletions components/Schedule/Table/Block/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ function BlockItem({

{description && (
<div
className={styles.description}
style={{ display: focused ? "block" : "none" }}
className={`transition-max-height overflow-hidden duration-300 ${
focused ? "max-h-96" : "max-h-0"
}`}
>
{description.split("\n").map((text, i) => (
<p key={i} className={`mb-2 font-iregular text-lg text-white`}>
Expand Down
Loading

0 comments on commit 95dc243

Please sign in to comment.