Skip to content

Commit

Permalink
show notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmasken committed Feb 13, 2024
1 parent 40f2122 commit abb2f71
Show file tree
Hide file tree
Showing 58 changed files with 48 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .dfx/network/local/ic-https-outcalls-adapter-pid
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12152
13400
2 changes: 1 addition & 1 deletion .dfx/network/local/icx-proxy-pid
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12311
13545
1 change: 1 addition & 0 deletions .dfx/network/local/pid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
13395
2 changes: 1 addition & 1 deletion .dfx/network/local/replica-configuration/replica-1.port
Original file line number Diff line number Diff line change
@@ -1 +1 @@
36825
39797
2 changes: 1 addition & 1 deletion .dfx/network/local/replica-configuration/replica-pid
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12159
13407
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
�i-(���������:��
�q/(���������:��
���
Ъ�
��
��
��@
߱˸D
��˸D
acknowledge_entries
add
add_tentative_device
Expand Down Expand Up @@ -36,7 +36,7 @@ $authn_method_registration_mode_enter%
remove
replace
update
verify_tentative_deviceget_anchor_credentialsget_delegation get_id_aliasget_principal http_requestidentity_authn_infolookupstats �i*ݹ
verify_tentative_deviceget_anchor_credentialsget_delegation get_id_aliasget_principal http_requestidentity_authn_infolookupstats �q*ݹ
O
candid:args@(opt InternetIdentityInit) �����Q&1��)�������p��Y���~
��
Expand Down Expand Up @@ -665,10 +665,9 @@ service : (opt InternetIdentityInit) -> {
dfx��{"pullable":{"wasm_url": "https://github.com/dfinity/internet-identity/releases/download/release-2024-02-02/internet_identity_dev.wasm.gz","dependencies": [],"init_guide": "Use '(null)' for sensible defaults. See the candid interface for more details."}} c�� #FK���X|�b�}"�Q�hs��l��
K
supported_certificate_versions)1,2 �Իbؗ�ь;Z�FATb��'��_�M�'�&��2 �B�v�;BT�� ܿ7���Mp��c򵻯���8Z
-x0��g�0� ɉH8�!Ѓ^�7�������
0��O �a |'��Ū������
�M�o��Z���
Ÿ�끏����1� �ː� �އ~� ���T�ֹ�W
/x2��s�2� �O��H�� ��C�<�����Ϙ=8R��D9�����������
��a��Z���
����������3� ���� ï�~� ��T�ֹ�W
��������

*
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
�i (�:�J
�u(�:�J
��R
��R
��@
�
���
icrc1_transfer!__get_candid_interface_tmp_hack
archives 
get_blocksget_data_certificateget_transactions http_requesticrc1_balance_oficrc1_decimals  icrc1_feeicrc1_metadataicrc1_minting_account 
icrc1_nameicrc1_supported_standards icrc1_symbolicrc1_total_supply �i*�F
icrc1_nameicrc1_supported_standards icrc1_symbolicrc1_total_supply �u*�F
�F
candid:service�F�Etype BlockIndex = nat;
type Subaccount = blob;
Expand Down Expand Up @@ -288,12 +288,12 @@ service : (ledger_arg : LedgerArg) -> {
`
git_commit_idO)b3b00ba59c366384e3e0cd53a69457e9053ec987
 }�o���>�#c,�%� �gN�]{���'�G\2 �% ���C.Q��f�L4�b("ɬS��28Z
 x��i��� u�W�6a#��2 �GI~G�(����է�Y�?'����������
x��u��� ����[�2"�#��������([���ɜ� ����������

��
�V� �1Kdz��u�1��Bԃ�XOLO��e�����
Ÿ�끏����� ���� �ǒW�
��
�V� �1Kdz��u�1��Bԃ�XOLO����!���
����������� ���� �ǒW�
����
�����
K�����"

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
�5(�:�>
�5(���������:�>
��E
��E
��@
Expand Down Expand Up @@ -299,12 +299,12 @@ service: (asset_canister_args: opt AssetCanisterArgs) -> {
K
supported_certificate_versions)1,2 �Իbؗ�ь;Z�FATb��'��_�M�'�&��2 <�����q3����L������]>Ք�~�l�08Z
5x
��h�
� �yg��1<W�~s���ޭ�6��G��s~��$���ϒ������
��t�
� �yg��1<W�~s���ޭ�6��G��s~��$��������

��
�V� �1Kdz��u�1��Bԃ�XOLO��gp����
Ÿ�끏����6� ����
�V� �1Kdz��u�1��Bԃ�XOLO��~����
����������6� ����
��Ɉ� ���8�
�����
K��ǭ����"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions canisters/backend/main.mo
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ public shared ({caller}) func getMyContactsLength() : async Text {

return #ok({notification});
};

//get notifications added by caller
public shared ({caller}) func getNotifications() : async [Notification] {
let allEntries = Iter.toArray(notifications.entries());
Expand Down
2 changes: 2 additions & 0 deletions frontend/store/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const useAuthStore = defineStore("auth", {
fundingaddress: null,
canisteraddress: null,
canisterbalance: null,
notifications: [],
isConfigured: null,
userInfo: null,
};
Expand Down Expand Up @@ -118,6 +119,7 @@ export const useAuthStore = defineStore("auth", {
const fundingaddress = await this.whoamiActor.getFundingAddress();
const canisteraddress = await this.whoamiActor.getCanisterAddress();
const canisterbalance = await this.whoamiActor.getCanisterBalance();
const notifications = await this.whoamiActor.getNotifications();
const config = await this.whoamiActor.userExists();
this.fundingbalance = await fundingbalance;
this.tradingbalance = await tradingbalance;
Expand Down
39 changes: 22 additions & 17 deletions frontend/views/Notifications.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
<template>
<div class="space-y-2 ">
<h1 class="uppercase tracking-widest text-gray-800 dark:text-white font-semibold">Transactions</h1>
<p class="uppercase tracking-widest text-gray-800 dark:text-white font-semibold">
This is a list of all your transactions
</p>
<div
class=" p-2 "
v-for="notification in notifications" :key="notification.id">


<TransactionCard :sender="notification.sender" :id="notification.id" :receiver="notification.receiver"
:amount="notification.amount"
/>
</div>

</div>
<!--div class="flex items-center justify-center h-screen bg-gray-900"-->
<div class="dark:bg-gray-800 bg-white rounded-lg shadow-xl p-8 w-full h-full">
<div class="mb-4">
<h1 class="font-semibold text-gray-50">Notifications</h1>
</div>
<div class=" p-2 " v-for="notification in notifications" :key="notification.id">
<div class="flex items-center mb-4">
<div class="mr-4">
<button class="inline-flex items-center justify-center w-14 h-14 text-blue-100 bg-gray-700 rounded-full">
gg
</button>
</div>
<div>
<p class="font-semibold dark:text-gray-50 text-gray-800">You received a payment of <span class="text-blue-500 font-bold">{{ notification.amount}}</span> from {{notification.sender}}</p>
<span class="text-xs dark:text-gray-500 text-gray-800">12 min ago</span>
</div>
</div>

</div>
</div>

</template>
<script setup>
import { useAuthStore } from "../store/auth";
Expand All @@ -27,7 +32,7 @@ let notifications = ref([]);
watchEffect(async () => {
const res = await authStore.whoamiActor?.getNotifications();
notifications.value = await res;
console.log(notifications);
console.log(res);
});
Expand Down

0 comments on commit abb2f71

Please sign in to comment.