Skip to content

Commit

Permalink
Merge pull request #52 from project-error/fix/ts-fixes01
Browse files Browse the repository at this point in the history
fix: tsfixes & uniqueaccount fixes
  • Loading branch information
antonstjernquist authored Sep 6, 2022
2 parents 7d70b97 + ee08516 commit 4c94554
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
1 change: 0 additions & 1 deletion typings/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export interface ResourceConfig {
};
database: {
profileQueries: boolean;
shouldSync: boolean;
};
prices: {
newAccount: number;
Expand Down
4 changes: 3 additions & 1 deletion web/src/components/Modals/AddUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ const AddUserModal = ({
};

const filteredUsers = users.filter((user) => {
const exists = existingUsers.find((existingUser) => existingUser.user === user.identifier);
const exists = existingUsers.find(
(existingUser) => existingUser.userIdentifier === user.identifier,
);
return !exists;
});

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/Modals/RemoveUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const RemoveUserModal = ({ isOpen, onSelect, onClose, accountId }: SelectUserMod
const filteredUsers = users
.map((user) => ({
name: user.name ?? '',
identifier: user.user,
identifier: user.userIdentifier,
isDisabled: [AccountRole.Owner].includes(user.role),
}))
.filter((user) => !user.isDisabled);
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/TransferFunds.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Alert, Box, FormHelperText, LinearProgress, Stack, Typography } from '@mui/material';
import { Alert, Box, FormHelperText, LinearProgress, Stack } from '@mui/material';
import { useAtom } from 'jotai';
import { accountsAtom, defaultAccountAtom } from '../data/accounts';
import { Heading5 } from './ui/Typography/Headings';
Expand Down
25 changes: 24 additions & 1 deletion web/src/mobileDevelopmentContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import image from './bg.png';
import { NuiProvider } from 'react-fivem-hooks';
import MobileApp from './views/Mobile/Mobile';
import i18n from '@utils/i18n';
import { IPhoneSettings } from '@project-error/npwd-types';

const Container = styled.div`
position: relative;
Expand Down Expand Up @@ -37,14 +38,36 @@ const AppContainer = styled.div`
border-radius: 20px;
`;

const mockedSetting = {
label: 'idk',
value: 'idk',
};
const mockedSettings: IPhoneSettings = {
language: mockedSetting,
iconSet: mockedSetting,
wallpaper: mockedSetting,
frame: mockedSetting,
theme: mockedSetting,
zoom: mockedSetting,
streamerMode: false,
ringtone: mockedSetting,
callVolume: 0,
notiSound: mockedSetting,
TWITTER_notiFilter: mockedSetting,
TWITTER_notiSound: mockedSetting,
TWITTER_notiSoundVol: 0,
TWITTER_notifyNewFeedTweet: false,
MARKETPLACE_notifyNewListing: false,
};

const Root = () => (
<HashRouter>
<NuiProvider>
<Container>
<Background src={image} />
<React.Suspense fallback="Loading phone">
<AppContainer>
<MobileApp settings={{ language: { label: 'Svenska', value: 'sv' } }} i18n={i18n} />
<MobileApp i18n={i18n} settings={mockedSettings} />
</AppContainer>
</React.Suspense>
</Container>
Expand Down
2 changes: 1 addition & 1 deletion web/src/views/accounts/SharedSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const SharedSettings = ({ accountId, isAdmin }: Props) => {
{users.map((user) => (
<TableRow
hover
key={user.user}
key={user.userIdentifier}
sx={{ '&:last-child td, &:last-child th': { border: 0 } }}
>
{/* TODO: Add (You) to yourself. */}
Expand Down

0 comments on commit 4c94554

Please sign in to comment.