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

Design review updates #266

Merged
merged 5 commits into from
May 21, 2024
Merged
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
10 changes: 3 additions & 7 deletions web-portal/backend/src/apps/apps.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,8 @@ export class AppsService {

async updateApp(appId: string, updateAppDto: any) {
const updatedApp = await this.prisma.client.app.update({
where: {
id: appId, deletedAt: {
not: null
}
},
data: updateAppDto,
where: {id: appId, deletedAt: { not : null }},
data: {...updateAppDto},
});

if (!updatedApp) {
Expand All @@ -123,7 +119,7 @@ export class AppsService {
const deletedAt = new Date()

const deletedApp = await this.prisma.client.app.update({
where: { id: appId },
where: { id: appId, deletedAt: { not: null } },
data: { deletedAt },
});

Expand Down
5 changes: 0 additions & 5 deletions web-portal/frontend/components/apps/appRules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,7 @@ const AppRules: React.FC<{ rule: Partial<IRuleType> }> = ({ rule }) => {
const values = existingData?.map((item) => (
<Pill
key={item.ruleId}
size="lg"
m={2}
bg={"blue"}
style={{
color: "white",
}}
>
{item.value
?.replace("P1D", "Daily")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,7 @@ export default function AllowedOriginsForm() {
key={item}
withRemoveButton
onRemove={() => handleValueRemove(item)}
size="lg"
m={2}
bg={"blue"}
style={{
color: "white",
}}
>
{item}
</Pill>
Expand All @@ -65,11 +60,9 @@ export default function AllowedOriginsForm() {
placeholder="Enter a valid Url"
type="url"
inputWrapperOrder={["label", "input", "description"]}
style={{ width: "100%" }}
{...form.getInputProps("url")}
/>
<Button
h={36}
onClick={() => {
if (formValidation().hasErrors) return;
setValue((current: any) => [form.values.url, ...current]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ export default function AllowedUserAgentsForm() {
key={item}
withRemoveButton
onRemove={() => handleValueRemove(item)}
size="lg"
m={2}
bg={"blue"}
style={{
color: "white",
}}
>
{item}
</Pill>
Expand All @@ -66,7 +61,6 @@ export default function AllowedUserAgentsForm() {
{...form.getInputProps("userAgent")}
/>
<Button
h={36}
onClick={() => {
if (formValidation().hasErrors) return;
setValue((current: any) => [form.values.userAgent, ...current]),
Expand Down
6 changes: 0 additions & 6 deletions web-portal/frontend/components/apps/forms/rateLimitForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,7 @@ export default function RateLimitForm() {
key={val}
withRemoveButton
onRemove={() => handleValueRemove(val)}
size="lg"
m={2}
bg="blue"
style={{
color: "white",
}}
>
{val
?.replace("P1D", "Daily")
Expand Down Expand Up @@ -115,7 +110,6 @@ export default function RateLimitForm() {
{...form.getInputProps("period")}
/>
<Button
h={36}
onClick={() => {
if (formValidation().hasErrors) return;
if (value.some((v) => v.includes(form.values.period))) {
Expand Down
24 changes: 18 additions & 6 deletions web-portal/frontend/components/common/SearchableMultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
Pill,
PillsInput,
useCombobox,
ScrollArea,
Text
} from "@mantine/core";

export function SearchableMultiSelect({
Expand Down Expand Up @@ -37,9 +39,6 @@ export function SearchableMultiSelect({
key={item}
withRemoveButton
onRemove={() => handleValueRemove(item)}
bg="blue"
c="#fff"
size="lg"
>
{item}
</Pill>
Expand All @@ -61,9 +60,15 @@ export function SearchableMultiSelect({
store={combobox}
onOptionSubmit={handleValueSelect}
withinPortal={true}
size="md"
>
<Combobox.DropdownTarget>
<PillsInput onClick={() => combobox.openDropdown()}>
<Combobox.DropdownTarget >
<PillsInput onClick={() => combobox.openDropdown()} size="md" styles={{
input: {
backgroundColor:'#FEFCFA'
},

}}>
<Pill.Group>
{values}

Expand All @@ -89,14 +94,21 @@ export function SearchableMultiSelect({
</PillsInput>
</Combobox.DropdownTarget>

<Combobox.Dropdown>
<Combobox.Dropdown style={{
backgroundColor:'#FEFCFA'
}}>
<ScrollArea.Autosize mah={200} type="scroll">
<Combobox.Options>
<Combobox.Header>
<Text fz="xs">Scroll to see more networks</Text>
</Combobox.Header>
{options.length > 0 ? (
options
) : (
<Combobox.Empty>Nothing found...</Combobox.Empty>
)}
</Combobox.Options>
</ScrollArea.Autosize>
</Combobox.Dropdown>
</Combobox>
);
Expand Down
10 changes: 9 additions & 1 deletion web-portal/frontend/pages/login/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import background from "@frontend/public/background.png";
import { Button, Container, Title, Box, BackgroundImage } from "@mantine/core";
import { Button, Container, Title, Box, BackgroundImage, Stack } from "@mantine/core";
import Image from "next/image";
import { useWeb3Modal } from "@web3modal/wagmi/react";
import logo from "@frontend/public/logo.png";
import WelcomeShape from "@frontend/components/login/welcomeshape";
import poweredByPokt from "@frontend/public/powered-by-pokt.png";
import { useAccount, useDisconnect } from "wagmi";
import { useAtomValue } from "jotai";
import { sessionAtom } from "@frontend/utils/atoms";
Expand Down Expand Up @@ -54,7 +55,14 @@ export default function Login() {
: "Connect Wallet"}
</Button>
</WelcomeShape>
<Container style={{
position: 'absolute',
bottom: 30
}}>
<Image src={poweredByPokt.src} width={poweredByPokt.width*0.35} height={poweredByPokt.height*0.35} alt="Powered By Pokt Network"/>
</Container>
</Container>

</BackgroundImage>
</Box>
);
Expand Down
Binary file added web-portal/frontend/public/powered-by-pokt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 89 additions & 1 deletion web-portal/frontend/utils/theme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createTheme, rem, Button, Input } from "@mantine/core";
import { createTheme, rem, Button, Modal, TextInput, Select, NumberInput, Textarea, Stack, Pill } from "@mantine/core";
import { Crimson_Text, Karla, Red_Rose } from "next/font/google";
export const crimson = Crimson_Text({
subsets: ["latin"],
Expand All @@ -19,6 +19,24 @@ export const redRose = Red_Rose({
weight: ["400", "600", "500", "700"],
});


const InputProps = {
size: 'md',
radius: 'xs',
style: {
width: '100%',
fontFamily: karla.style.fontFamily,
},
styles:{
input: {
fontSize: rem(15),
height: rem(36),
backgroundColor: '#FEFCFA',
},

}
}

export const theme = createTheme({
white: "#F6EEE6",
black: "#3C2B27",
Expand Down Expand Up @@ -68,5 +86,75 @@ export const theme = createTheme({
},
},
}),
TextInput: TextInput.extend({
defaultProps:InputProps
}),
Textarea: Textarea.extend({
defaultProps: {
size: 'md',
radius: 'xs',
style: {
width: '100%',
fontFamily: karla.style.fontFamily,
},
styles:{
input: {
fontSize: rem(15),
backgroundColor: '#FEFCFA',
height: 100,
},
}
}
}),
NumberInput: NumberInput.extend({
defaultProps:InputProps
}),
Select: Select.extend({
defaultProps:{
size: 'md',
radius: 'xs',
styles:{
input:{
backgroundColor: '#FEFCFA',
},
dropdown: {
backgroundColor: '#FEFCFA',
}
}
}
}),
Pill: Pill.extend({
defaultProps:{
size: 'xl',
bg:"#F9DCBF",
style:{
color: "#3C2B27",
fontFamily: karla.style.fontFamily,
fontSize: rem(15),
fontWeight: 500
}
}
}),
Modal: Modal.extend({
defaultProps: {
size:'lg',
padding: '28 44 28 44',
style: {
position: 'relative',
fontFamily: karla.style.fontFamily,
},
styles:{
title: {
fontWeight: 700,
fontSize: rem(18),
},
close: {
position: 'fixed',
top: 12,
right: 12
}
}
}
})
},
});
Loading