Skip to content

Commit

Permalink
added partition (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha authored Feb 11, 2024
1 parent 9b6d508 commit d91d388
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 9 deletions.
44 changes: 40 additions & 4 deletions apps/box/src/components/Cards/ConnectedDevicesCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import {
FxLoadingSpinner,
FxRefreshIcon,
FxTag,
FxText,
FxPoolIcon,
useToast,
} from '@functionland/component-library';
import { CardCarousel } from './fields/CardCarousel';
import { EmptyCard } from './EmptyCard';
import { BottomSheetModalMethods } from '@gorhom/bottom-sheet/lib/typescript/types';
import { TDevice, EDeviceStatus, mockHub } from '../../api/hub';
import { ActivityIndicator } from 'react-native';
import { ActivityIndicator, Alert } from 'react-native';
import { fxblox } from '@functionland/react-native-fula';

const DEVICE_CARD_HEIGHT = 264;

Expand All @@ -36,6 +38,7 @@ export const DeviceCard = ({
}: DeviceCardProps) => {
const bottomSheetRef = React.useRef<BottomSheetModalMethods>(null);
const { name, capacity, status, associatedDevices, used, free } = data;
const { queueToast } = useToast();

return (
<FxCard
Expand Down Expand Up @@ -97,14 +100,47 @@ export const DeviceCard = ({
</FxButton>
)}
{children}
<FxBottomSheetModal ref={bottomSheetRef} title="Device Bottom Sheet">
<FxBottomSheetModal ref={bottomSheetRef} title="Device Actions">
<FxBox
height={200}
justifyContent="center"
alignItems="center"
paddingHorizontal="20"
>
<FxText>This bottom sheet needs to be completed</FxText>
<FxButton
onPress={() => {
Alert.alert(
'Format Blox Partition!',
`Are you sure want to format external blox partitions?`,
[
{
text: 'Yes',
onPress: () => {
fxblox.partition().then(() => {
console.log('partition sent');
queueToast({
type: 'success',
title: 'Request Sent',
message:
'The parition request is sent. Please wait 5 minutes as your blox restarts after partitioning',
});
});
},
style: 'destructive',
},
{
text: 'No',
style: 'cancel',
},
]
);
}}
flexWrap="wrap"
paddingHorizontal="16"
iconLeft={<FxPoolIcon />}
>
Format
</FxButton>
</FxBox>
</FxBottomSheetModal>
</FxCard>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@babel/preset-env": "^7.1.6",
"@ethersproject/shims": "^5.7.0",
"@functionland/fula-sec": "^2.0.0",
"@functionland/react-native-fula": "1.44.1",
"@functionland/react-native-fula": "1.44.2",
"@gorhom/bottom-sheet": "^4.5.1",
"@metamask/sdk-react": "^0.14.2",
"@notifee/react-native": "^7.8.2",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2405,10 +2405,10 @@
"@babel/runtime" "~7.17.2"
"@protobuf-ts/runtime" "~2.2.2"

"@functionland/[email protected].1":
version "1.44.1"
resolved "https://registry.yarnpkg.com/@functionland/react-native-fula/-/react-native-fula-1.44.1.tgz#4146663f1a7e6fe43b8af9d12d5058315664d254"
integrity sha512-HNBFPWGQd8DrkhLEqZWX4nrFq3dmuNQfJNEQ6ZE2/TCTYrRwsdt3lvH40j6YmTGamrYfpoeA0fTpaUfh8898JA==
"@functionland/[email protected].2":
version "1.44.2"
resolved "https://registry.yarnpkg.com/@functionland/react-native-fula/-/react-native-fula-1.44.2.tgz#5f7777593af88f3627d7c8aa0abbc8aee72fa3db"
integrity sha512-FnXg2LASuNvKXPE/ZtCdTexdD44E0p9mYTiD0uIEm4Z6RLbPheQJ64xHwA7WO0Dh8267+JaFp0V17S00kaZgnQ==
dependencies:
"@polkadot/api" "^9.11.3"
"@polkadot/keyring" "^10.2.6"
Expand Down

0 comments on commit d91d388

Please sign in to comment.