Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fair launch url #423

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"remark": "^15.0.1",
"remark-gfm": "^4.0.0",
"remark-html": "^16.0.1",
"rss-parser": "^3.13.0",
"sharp": "^0.33.4",
"sonner": "^1.4.41",
"tailwind-merge": "^2.2.0",
Expand Down
1 change: 0 additions & 1 deletion src/common/components/atoms/reorderable-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as React from "react";
import { motion, Reorder } from "framer-motion";
import { CloseIcon } from "./icons/CloseIcon";
import EditableText from "./editable-text";
import { FaX } from "react-icons/fa6";

interface Props {
tabName: string;
Expand Down
3 changes: 0 additions & 3 deletions src/common/components/molecules/DaoSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import React from "react";
import {
Select,
SelectGroup,
SelectValue,
SelectTrigger,
SelectContent,
SelectLabel,
SelectItem,
SelectSeparator,
} from "@/common/components/atoms/select";

import { DAO_OPTIONS } from "@/constants/basedDaos";
Expand Down
32 changes: 32 additions & 0 deletions src/common/components/molecules/ImageScaleSlider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from "react";
import { Slider } from "@mui/material";

export type ImageScaleSliderProps = {
min: number;
max: number;
step?: number;
defaultValue?: number;
onChange: (value: number) => void;
};

const ImageScaleSlider: React.FC<ImageScaleSliderProps> = ({
min = 0.2,
max = 3,
step = 0.1,
defaultValue = 1,
onChange,
}) => {
return (
<div className="ml-3 mr-3">
<Slider
defaultValue={defaultValue}
step={step}
min={min}
max={max}
onChange={(_, value) => onChange(value as number)}
/>
</div>
);
};

export default ImageScaleSlider;
7 changes: 4 additions & 3 deletions src/common/components/molecules/LinksInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ const LinksInput = forwardRef<HTMLInputElement, LinksInputProps>(
const newLink = {
text: "New Link",
url: "https://",
avatar: "/images/chainEmoji.png",
avatar: "https://www.nounspace.com/images/chainEmoji.png",
description: "Description",
};

onChange?.([...value, newLink]);
setVisibleFields([...visibleFields, true]); // Automatically expand new link
setVisibleFields([...visibleFields, true]);
};

const removeLink = (index: number) => {
Expand Down Expand Up @@ -133,8 +133,9 @@ const LinksInput = forwardRef<HTMLInputElement, LinksInputProps>(
value={link.url}
onChange={(e: any) => {
handleLinkChange(index, { ...link, url: e.target.value });
showAdditionalFields(index); // Show fields when URL is updated
showAdditionalFields(index);
}}
onFocus={() => showAdditionalFields(index)}
/>
<TextFieldSlot>
<p
Expand Down
4 changes: 2 additions & 2 deletions src/common/components/molecules/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ const Modal = ({
title,
description,
children,
focusMode,
focusMode = true,
showClose = true,
overlay = true,
}: ModalProps) => (
<Dialog.Root open={open} onOpenChange={setOpen} modal={focusMode || true}>
<Dialog.Root open={open} onOpenChange={setOpen} modal={focusMode}>
<Dialog.Portal>
{overlay && open && (
<Dialog.Overlay className="bg-muted/95 data-[state=open]:animate-overlayShow fixed inset-0 z-50" />
Expand Down
6 changes: 3 additions & 3 deletions src/common/components/organisms/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ const Navigation: React.FC<NavProps> = ({ isEditable, enterEditMode }) => {
<Modal
open={showCastModal}
setOpen={setShowCastModal}
focusMode
focusMode={false}
showClose={false}
>
<CreateCast />
<CreateCast afterSubmit={() => setShowCastModal(false)} />
</Modal>
<SearchModal ref={searchRef} />
<div className="pt-12 pb-12 h-full md:block hidden">
Expand Down Expand Up @@ -213,7 +213,7 @@ const Navigation: React.FC<NavProps> = ({ isEditable, enterEditMode }) => {
<NavItem
label="Fair Launch"
Icon={RocketIcon}
href="https://space.nounspace.com/"
href="/s/spacetoken"
onClick={() =>
trackAnalyticsEvent(AnalyticsEvent.CLICK_SPACE_FAIR_LAUNCH)
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/components/organisms/NogsChecker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function NogsChecker() {
return (
<>
<p className="mb-2">
Tabs are only for early supporters holding a nounspace OG NFT (nOGs){" "}
For now Tabs are only for early supporters holding a nounspace OG NFT (nOGs){" "}
<br />
Mint a pair{" "}
<a
Expand Down
3 changes: 1 addition & 2 deletions src/common/components/organisms/TabBar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from "react";
import AddFidgetIcon from "@/common/components/atoms/icons/AddFidget";
import { FaPlus } from "react-icons/fa6";
import { first, map } from "lodash";
import { useLoadFarcasterUser } from "@/common/data/queries/farcaster";
Expand Down Expand Up @@ -352,7 +351,7 @@ const TabBar = memo(function TabBar({
</Reorder.Group>

{inEditMode ? (
<div className="flex flex-row pr-32">
<div className="flex flex-row pr-32 z-infinity">
<NogsGateButton
onClick={handleCreateTab}
className="items-center flex rounded-xl p-2 m-3 px-auto bg-[#F3F4F6] hover:bg-sky-100 text-[#1C64F2] font-semibold"
Expand Down
4 changes: 2 additions & 2 deletions src/common/components/templates/Space.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactNode, useEffect, useMemo } from "react";
import React, { ReactNode, useEffect } from "react";
import {
FidgetConfig,
FidgetInstanceData,
Expand Down Expand Up @@ -109,14 +109,14 @@ export default function Space({

return (
<div className="user-theme-background w-full h-full relative flex-col">
<CustomHTMLBackground html={config.theme?.properties.backgroundHTML} />
{isNil(profile) && (
<TabBar
hasProfile={!isNil(profile)}
inEditMode={editMode}
profileFid={fid ? fid : 0}
/>
)}
<CustomHTMLBackground html={config.theme?.properties.backgroundHTML} />
<div className="w-full transition-all duration-100 ease-out h-[calc(100vh-64px)]">
<div className="flex flex-col h-full">
<div style={{ position: "fixed", zIndex: 9999 }}>
Expand Down
15 changes: 9 additions & 6 deletions src/common/components/templates/SpaceLoading.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
import React, { ReactNode, useMemo } from "react";
import React, { ReactNode, useState, useEffect } from "react";
import { isUndefined } from "lodash";
import useWindowSize from "@/common/lib/hooks/useWindowSize";

export default function SpaceLoading({ profile }: { profile?: ReactNode }) {
const [rowHeight, setRowHeight] = useState(70);
const { height } = useWindowSize();
const maxRows = 12;
const cols = 12;
const margin = [16, 16];
const containerPadding = [16, 16];
const { height } = useWindowSize();
const rowHeight = useMemo(
() =>

useEffect(() => {
setRowHeight(
height
? Math.round(
// The 64 magic number here is the height of the tabs bar above the grid
(height - 64 - margin[0] * maxRows - containerPadding[0] * 2) /
maxRows,
)
: 70,
[height],
);
),
[height];
});

return (
<>
Expand Down
1 change: 0 additions & 1 deletion src/common/fidgets/FidgetWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ export function FidgetWrapper({
homebaseConfig: state.homebase.homebaseConfig,
}));

console.log(homebaseConfig);
function onClickEdit() {
setSelectedFidgetID(bundle.id);
setCurrentFidgetSettings(
Expand Down
10 changes: 8 additions & 2 deletions src/common/fidgets/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import HTMLInput from "@/common/ui/molecules/HTMLInput";
import ColorSelector from "@/common/components/molecules/ColorSelector";
import FontSelector from "@/common/components/molecules/FontSelector";
import type { ThemeSettings, FontFamily, Color } from "@/common/lib/theme";

import SwitchButton from "../components/molecules/ViewSelector";
import ImageScaleSlider from "@/common/components/molecules/ImageScaleSlider";
export type FidgetSettings = Record<string, any>;
export type FidgetSettingsStyle = {
background?: Color;
Expand All @@ -15,6 +16,9 @@ export type FidgetSettingsStyle = {
fidgetBorderWidth?: string;
fidgetBorderColor?: Color;
fidgetShadow?: string;
itemBorderWidth?: string;
itemBorderColor?: Color;
itemBackground?: Color;
};
export type FidgetData = Record<string, any>;

Expand All @@ -38,7 +42,9 @@ export type FidgetFieldConfig<S extends FidgetSettings = FidgetSettings> = {
| typeof ColorSelector
| typeof FontSelector
| typeof CSSInput
| typeof HTMLInput;
| typeof HTMLInput
| typeof ImageScaleSlider
| typeof SwitchButton; // change the name of ViewSelector.tsx file in next link fidget PR
readonly default?: any;
readonly required: boolean;
readonly group?: FidgetGroup;
Expand Down
2 changes: 1 addition & 1 deletion src/common/lib/theme/ThemeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const ThemeCard = ({

return (
<div
className={`bg-gray-50 hover:bg-gray-100 rounded-lg grid [grid-template-areas:'cell'] h-11 cursor-pointer relative ${active ? activeRingBeforeElementClasses : ""}`}
className={`shadow-md w-full bg-gray-50 hover:bg-gray-100 rounded-lg grid [grid-template-areas:'cell'] h-11 cursor-pointer relative ${active ? activeRingBeforeElementClasses : ""}`}
style={{
backgroundColor: themeProps.background,
}}
Expand Down
16 changes: 13 additions & 3 deletions src/common/lib/theme/ThemeSettingsEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ import { FaInfoCircle } from "react-icons/fa";
import { THEMES } from "@/constants/themes";
import { ThemeCard } from "@/common/lib/theme/ThemeCard";
import { FONT_FAMILY_OPTIONS_BY_NAME } from "@/common/lib/theme/fonts";
import { GiOpenBook } from "react-icons/gi";
import { FaBook } from "react-icons/fa";
import { MdMenuBook } from "react-icons/md";

export type ThemeSettingsEditorArgs = {
theme: ThemeSettings;
Expand Down Expand Up @@ -153,9 +156,16 @@ export function ThemeSettingsEditor({
type="checkbox"
/>
{/* Templates Dropdown */}
<span className="block max-h-12 max-w-xs overflow-hidden rounded-lg transition-all duration-300 peer-checked/showLabel:max-h-full p-1">
{/* Theme Card Example */}
<ThemeCard themeProps={theme.properties} />
<span className="block max-h-14 max-w-xs overflow-hidden rounded-lg transition-all duration-300 peer-checked/showLabel:max-h-full p-1">
<div className="flex flex-row w-full">
<div className="flex basis-3/4 grow">
{/* Theme Card Example */}
<ThemeCard themeProps={theme.properties} />
</div>
<div className="flex basis-1/4 items-center justify-center">
<MdMenuBook className="w-6 h-6" />
</div>
</div>

<div className="grid grid-cols-2 gap-3 pb-3 pt-3">
{THEMES.map((theme, i) => (
Expand Down
5 changes: 2 additions & 3 deletions src/common/lib/utils/generateUserMetadataHtml.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const generateUserMetadataHtml = (userMetadata?: UserMetadata) => {
<meta property="twitter:domain" content="https://nounspace.com/" />
<meta property="og:url" content={spaceUrl} />
<meta property="twitter:url" content={spaceUrl} />
<meta property="og:image" content={ogImageUrl} />
{bio && (
<>
<meta name="description" content={bio} />
Expand All @@ -41,9 +40,9 @@ export const generateUserMetadataHtml = (userMetadata?: UserMetadata) => {
)}
{pfpUrl && (
<>
<meta property="og:image" content={pfpUrl} />
<meta name="twitter:card" content={pfpUrl} />
<meta name="twitter:image" content={pfpUrl} />
<meta property="og:image" content={ogImageUrl} />
<meta name="twitter:image" content={ogImageUrl} />
</>
)}
</>
Expand Down
31 changes: 20 additions & 11 deletions src/common/lib/utils/markdownRenderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type RendererProps = MarkdownProps & {
href?: any;
};

export const MarkdownRenderers = {
export const MarkdownRenderers = (linkColor?: string) => ({
img: ({ alt, src, title, ...props }: RendererProps) => (
<span
style={{
Expand Down Expand Up @@ -45,15 +45,24 @@ export const MarkdownRenderers = {
{children}
</div>
),
a: ({ href, children, ...props }: RendererProps) => (
<a
style={{ color: "blue", textWrap: "wrap", wordBreak: "break-all" }}
href={href}
{...props}
>
{children}
</a>
),
a: ({ href, children, ...props }: RendererProps) => {
const isPrettyLink = href !== children;

const style: React.CSSProperties = isPrettyLink
? { color: linkColor, wordBreak: "keep-all", overflowWrap: "normal" }
: {
color: linkColor,
wordBreak: "break-all",
overflowWrap: "break-word",
};

return (
<a href={href} style={style} {...props}>
{children}
</a>
);
},

h1: ({ children, ...props }: RendererProps) => (
<h1
{...props}
Expand Down Expand Up @@ -248,4 +257,4 @@ export const MarkdownRenderers = {
{children}
</code>
),
};
});
1 change: 0 additions & 1 deletion src/constants/intialHomebase.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { SpaceConfig } from "@/common/components/templates/Space";
import DEFAULT_THEME from "@/common/lib/theme/defaultTheme";
import { FeedType } from "@neynar/nodejs-sdk";

const layoutID = "";
const INITIAL_HOMEBASE_CONFIG: SpaceConfig = {
Expand Down
6 changes: 3 additions & 3 deletions src/fidgets/farcaster/Feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const feedProperties: FidgetProperties<FeedFidgetSettings> = {
displayName: "Select App",
inputSelector: PlatformSelector,
required: false,
default: { name: "farcaster", icon: "/images/farcaster.jpeg" },
default: { name: "Farcaster", icon: "/images/farcaster.jpeg" },
},
{
fieldName: "feedType",
Expand All @@ -109,7 +109,7 @@ const feedProperties: FidgetProperties<FeedFidgetSettings> = {
displayName: "Username",
inputSelector: TextInput,
required: false,
disabledIf: (settings) => settings.selectPlatform.name === "Farcaster",
disabledIf: (settings) => settings.selectPlatform.name === "farcaster",
default: "thenounspace",
},
{
Expand Down Expand Up @@ -206,7 +206,7 @@ export const FEED_TYPES = [

const Feed: React.FC<FidgetArgs<FeedFidgetSettings>> = ({ settings }) => {
const {
selectPlatform = { name: "farcaster", icon: "/images/farcaster.jpeg" },
selectPlatform = { name: "Farcaster", icon: "/images/farcaster.jpeg" },
Xhandle,
style,
} = settings;
Expand Down
1 change: 0 additions & 1 deletion src/fidgets/farcaster/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import FrameEmbed from "./components/Embeds/FrameEmbed";
import { isValidUrl } from "@/common/lib/utils/url";
import useSafeUrl from "@/common/lib/hooks/useSafeUrl";
import { defaultStyleFields } from "@/fidgets/helpers";
import ColorSelector from "@/common/components/molecules/ColorSelector";
import BorderSelector from "@/common/components/molecules/BorderSelector";
import ShadowSelector from "@/common/components/molecules/ShadowSelector";
Expand Down
Loading