Skip to content

Commit

Permalink
Create Asset.js
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 25, 2024
1 parent c9d9032 commit 7634d2a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions client/components/Asset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import { View, Text, TouchableOpacity } from 'react-native';
import { AssetService } from '../services/AssetService';

const Asset = ({ asset }) => {
const [assetData, setAssetData] = useState(asset);

const handleAssetDetails = async () => {
const assetDetails = await AssetService.getAssetDetails(assetData.id);
setAssetData(assetDetails);
};

return (
<View>
<Text>{assetData.name}</Text>
<Text>{assetData.symbol}</Text>
<Text>{assetData.balance}</Text>
<TouchableOpacity onPress={handleAssetDetails}>
<Text>View Details</Text>
</TouchableOpacity>
</View>
);
};

export default Asset;

0 comments on commit 7634d2a

Please sign in to comment.