Skip to content

Commit

Permalink
Working device registration and listing
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocky43007 committed Sep 13, 2024
1 parent dc19f79 commit a810327
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 19 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/src/node/hardware.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::io;
use std::io::Error;

use serde::{Deserialize, Serialize};
use specta::Type;
Expand Down
29 changes: 19 additions & 10 deletions interface/app/$libraryId/settings/client/account/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Envelope } from '@phosphor-icons/react';
import { getAccessToken } from 'supertokens-web-js/recipe/session';
import { useBridgeMutation, useBridgeQuery } from '@sd/client';
import { Button, Card } from '@sd/ui';
import StatCard from '~/app/$libraryId/overview/StatCard';
import { TruncatedText } from '~/components';
import { hardwareModelToIcon } from '~/util/hardware';

const Profile = ({ email }: { email?: string }) => {
const emailName = email?.split('@')[0];
Expand Down Expand Up @@ -61,17 +63,24 @@ const Profile = ({ email }: { email?: string }) => {
Delete Device
</Button>
{/* List all devices from const devices */}
{/* {devices.data?.map((device: any) => (
<Card
{devices.data?.map((device) => (
// <Card
// key={device.pub_id}
// className="w-full items-center justify-start gap-1 bg-app-input !px-2"
// >

// </Card>
<StatCard
key={device.pub_id}
className="w-full items-center justify-start gap-1 bg-app-input !px-2"
>
<div className="w-[20px]">
<Envelope weight="fill" width={20} />
</div>
<TruncatedText>{device.pub_id}</TruncatedText>
</Card>
))} */}
name={device.name}
// TODO (Optional): Use Brand Type for Different Android Models/iOS Models using DeviceInfo.getBrand()
icon={hardwareModelToIcon(device.hardware_model)}
totalSpace={device.storage_size.toString()}
freeSpace={(device.storage_size - device.used_storage).toString()}
color="#0362FF"
connectionType={'cloud'}
/>
))}
</div>
);
};
Expand Down
8 changes: 4 additions & 4 deletions packages/client/src/core.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a810327

Please sign in to comment.