Skip to content

Commit

Permalink
Primal Premium init
Browse files Browse the repository at this point in the history
  • Loading branch information
moysa committed Feb 9, 2024
1 parent 2c8df37 commit 4bb602f
Show file tree
Hide file tree
Showing 15 changed files with 794 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const EditProfile = lazy(() => import('./pages/EditProfile'));
const Profile = lazy(() => import('./pages/Profile'));
const Mutelist = lazy(() => import('./pages/Mutelist'));
const CreateAccount = lazy(() => import('./pages/CreateAccount'));
const Premium = lazy(() => import('./pages/Premium/Premium'));

const NotifSettings = lazy(() => import('./pages/Settings/Notifications'));
const Account = lazy(() => import('./pages/Settings/Account'));
Expand Down Expand Up @@ -129,6 +130,8 @@ const Router: Component = () => {
<Route path="/rest" component={Explore} />
<Route path="/mutelist/:npub" component={Mutelist} />
<Route path="/new" component={CreateAccount} />
<Route path="/premium/:step?" component={Premium} />

<Route path="/404" component={NotFound} />
<Route path="/:vanityName" component={Profile} data={getKnownProfiles} />
</Route>
Expand Down
15 changes: 15 additions & 0 deletions src/assets/icons/orange_check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/components/Buttons/ButtonFlip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const ButtonFollow: Component<{
return props.when ? styles.flipActive : styles.flipInactive;
}

const fallback = () => props.fallback || props.children

return (
<Button.Root
id={props.id}
Expand All @@ -28,7 +30,7 @@ const ButtonFollow: Component<{
<span>
<Show
when={props.when}
fallback={props.fallback}
fallback={fallback()}
>
{props.children}
</Show>
Expand Down
27 changes: 27 additions & 0 deletions src/components/Buttons/ButtonPremium.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Component, JSXElement, Match, Show, Switch } from 'solid-js';
import { hookForDev } from '../../lib/devTools';
import { Button } from "@kobalte/core";

import styles from './Buttons.module.scss';

const ButtonPremium: Component<{
id?: string,
onClick?: (e: MouseEvent) => void,
children?: JSXElement,
disabled?: boolean,
type?: 'button' | 'submit' | 'reset' | undefined,
}> = (props) => {
return (
<Button.Root
id={props.id}
class={styles.premium}
onClick={props.onClick}
disabled={props.disabled}
type={props.type}
>
{props.children}
</Button.Root>
)
}

export default hookForDev(ButtonPremium);
18 changes: 18 additions & 0 deletions src/components/Buttons/Buttons.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,21 @@
background-color: var(--subtile-devider);
}
}

.premium {
display: flex;
justify-content: center;
align-items: center;
border: none;
border-radius: 99999px;
margin: 0px;
padding-inline: 18px;
padding-block: 10px;
font-size: 16px;
line-height: 16px;
font-weight: 600;
background: var(--premium-orange);
color: var(--text-primary-button);
width: 100%;
min-height: 36px;
}
9 changes: 6 additions & 3 deletions src/components/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ const TextInput: Component<{
autocomplete?: string,
name?: string,
noExtraSpace?: boolean,
inputClass?: string,
descriptionClass?: string,
errorClass?: string,
}> = (props) => {

return (
Expand All @@ -38,7 +41,7 @@ const TextInput: Component<{
<div class={styles.inputWrapper}>
<TextField.Input
ref={props.ref}
class={styles.input}
class={`${styles.input} ${props.inputClass || ''}`}
readOnly={props.readonly}
type={props.type || 'search'}
name={props.name || 'searchTerm'}
Expand All @@ -53,12 +56,12 @@ const TextInput: Component<{
</div>

<Show when={props.description}>
<TextField.Description class={styles.description}>
<TextField.Description class={`${styles.description} ${props.descriptionClass || ''}`}>
{props.description}
</TextField.Description>
</Show>

<TextField.ErrorMessage class={styles.errorMessage}>
<TextField.ErrorMessage class={`${styles.errorMessage} ${props.errorClass || ''}`}>
{props.errorMessage}
</TextField.ErrorMessage>
</TextField.Root>
Expand Down
2 changes: 2 additions & 0 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
--warning-color: #FA3C3C;
--success-color: #66E205;

--premium-orange: #FA3C3C;

--left-col-w: 187px;
--center-col-w: 602px;
--right-col-w: 348px;
Expand Down
16 changes: 16 additions & 0 deletions src/lib/premium.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const checkPremiumName = (name: string, subId: string, socket: WebSocket) => {
const message = JSON.stringify([
"REQ",
subId,
{cache: ["membership_name_available", { name }]},
]);

if (socket) {
const e = new CustomEvent('send', { detail: { message, ws: socket }});

socket.send(message);
socket.dispatchEvent(e);
} else {
throw('no_socket');
}
}
227 changes: 227 additions & 0 deletions src/pages/Premium/Premium.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
.premiumContent {
width: 100%;
border-top: 1px solid var(--devider);
padding-top: 20px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;

.premiumStepContent {
width: 432px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;

.title {
font-size: 16px;
font-weight: 600;
line-height: 20px;
color: var(--text-secondary);
text-transform: uppercase;
margin-bottom: 24px;
}

.input {
width: 280px;

.centralize {
text-align: center;
}

.centralError {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
}

.congrats {
color: var(--text-primary);
font-size: 20px;
font-weight: 600;
line-height: 28px;

display: flex;
flex-direction: column;
justify-content: center;
align-items: center;

margin-bottom: 24px;
}
}
}

.premiumSummary {
border-top: 1px solid var(--devider);
padding-top: 26px;
margin-bottom: 48px;

display: flex;
width: 100%;
flex-direction: column;
align-items: flex-start;

.summaryItem {
display: flex;
width: 100%;
justify-content: space-between;
align-items: center;

font-size: 14px;
font-weight: 400;
line-height: 48px;
color: var(--text-secondary);

.summaryName {
font-weight: 700;
color: var(--text-primary);
}
}
}

.premiumProfile {
display: flex;
width: 100%;
flex-direction: column;
align-items: center;
justify-content: center;
margin-bottom: 28px;
gap: 16px;

.userInfo {
display: flex;
align-items: center;
justify-content: center;

color: var(--text-primary);
font-size: 22px;
font-weight: 700;
line-height: 24px;
}
}

.subOptions {
display: flex;
width: 100%;
gap: 16px;
justify-content: space-between;
align-items: center;
margin-bottom: 28px;

.selectedOption {
display: flex;
justify-content: center;
align-items: center;
gap: 8px;

.price {
font-size: 18px;
font-weight: 700;
line-height: 18px;
}

.duration {
color: var(--text-tertiary);
font-size: 14px;
font-weight: 600;
line-height: 14px;

&.hot {
color: var(--text-secondary);
}
}
}
}

.subscribeModal {
position: fixed;

display: flex;
flex-direction: column;
padding: 20px 24px 28px 24px;
width: 472px;
height: 616px;
border-radius: 12px;
background: var(--background-input);

.header {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 24px;

.userInfo {
display: flex;
justify-content: flex-start;
align-items: flex-start;

.avatar {
display: flex;
align-items: center;
justify-content: center;
}

.details {
display: flex;
flex-direction: column;
margin-left: 8px;
justify-content: center;
height: 44px;

.name {
display: flex;
flex-direction: row;
align-items: center;
color: var(--text-primary);
font-size: 20px;
font-weight: 700;
line-height: 20px;
}

.verification {
color: var(--text-tertiary);
font-size: 16px;
font-weight: 400;
line-height: 16px;
}
}

}

.close {
border: none;
outline: none;
padding: 0;
margin: 0;
box-shadow: none;
width: 20px;
height: 20px;
display: inline-block;
margin: 0px 0px;
background-color: var(--text-secondary);
-webkit-mask: url(../../assets/icons/close.svg) no-repeat center;
mask: url(../../assets/icons/close.svg) no-repeat center;

&:hover {
background-color: var(--text-primary);
}
}
}
}

.orangeCheck {
width: 24px;
height: 24px;
display: inline-block;
background-image: url(../../assets/icons/orange_check.svg);
margin-inline: 6px;

&.small {
width: 18px;
height: 18px;
background-size: 18px;
}
}
Loading

0 comments on commit 4bb602f

Please sign in to comment.