Skip to content

Commit

Permalink
feat: imports social icons from Astar-UI
Browse files Browse the repository at this point in the history
  • Loading branch information
impelcrypto committed Feb 9, 2023
1 parent 6f8b209 commit 755dcd3
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 89 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"dependencies": {
"@astar-network/astar-sdk-core": "^0.1.8",
"@astar-network/astar-ui": "^0.0.73",
"@astar-network/astar-ui": "^0.0.74",
"@ethersproject/bignumber": "^5.5.0",
"@polkadot/api": "^9.13.6",
"@polkadot/api-contract": "^9.13.6",
Expand Down
Binary file removed src/assets/img/discord.png
Binary file not shown.
Binary file removed src/assets/img/facebook.png
Binary file not shown.
Binary file removed src/assets/img/instagram.png
Binary file not shown.
Binary file removed src/assets/img/reddit.png
Binary file not shown.
Binary file removed src/assets/img/tiktok.png
Binary file not shown.
Binary file removed src/assets/img/twitter.png
Binary file not shown.
Binary file removed src/assets/img/youtube.png
Binary file not shown.
11 changes: 7 additions & 4 deletions src/components/common/Avatar.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<template>
<img :src="url" class="tw-rounded-full image-shadow" />
<div class="tw-rounded-full image-shadow">
<astar-icon-social :icon="iconName" />
</div>
</template>

<script lang="ts">
import { defineComponent, toRefs } from 'vue';
import { defineComponent, toRefs, PropType } from 'vue';
import { SocialIcon } from '@astar-network/astar-ui';
export default defineComponent({
props: {
url: {
type: String,
iconName: {
type: Object as PropType<SocialIcon>,
required: true,
},
},
Expand Down
21 changes: 11 additions & 10 deletions src/components/dapp-staking/register/components/Community.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@remove="removeCommunity(index)"
@click="editCommunity()"
>
<avatar :url="getCommunityIconUrl(community.type)" class="avatar" />
<avatar :icon-name="getCommunityIconName(community.type)" class="avatar" />
</image-card>
<image-card description="Add an account" class="card">
<add-item-card @click="addCommunity" />
Expand Down Expand Up @@ -51,6 +51,7 @@ import Avatar from 'src/components/common/Avatar.vue';
import ModalAddCommunity from './ModalAddCommunity.vue';
import { useI18n } from 'vue-i18n';
import { isUrlValid } from 'src/components/common/Validators';
import { SocialIcon } from '@astar-network/astar-ui';
export default defineComponent({
components: {
Expand Down Expand Up @@ -79,42 +80,42 @@ export default defineComponent({
{
type: CommunityType.Discord,
handle: '',
iconUrl: require('src/assets/img/discord.png'),
iconName: SocialIcon.Discord,
label: t('dappStaking.modals.community.discordAccount'),
validateHandle: (x) => validateUrl(x),
},
{
type: CommunityType.Twitter,
handle: '',
iconUrl: require('src/assets/img/twitter.png'),
iconName: SocialIcon.Twitter,
label: t('dappStaking.modals.community.twitterAccount'),
validateHandle: (x) => validateUrl(x),
},
{
type: CommunityType.Reddit,
handle: '',
iconUrl: require('src/assets/img/reddit.png'),
iconName: SocialIcon.Reddit,
label: t('dappStaking.modals.community.redditAccount'),
validateHandle: (x) => validateUrl(x),
},
{
type: CommunityType.Facebook,
handle: '',
iconUrl: require('src/assets/img/facebook.png'),
iconName: SocialIcon.Facebook,
label: t('dappStaking.modals.community.facebookAccount'),
validateHandle: (x) => validateUrl(x),
},
{
type: CommunityType.YouTube,
handle: '',
iconUrl: require('src/assets/img/youtube.png'),
iconName: SocialIcon.Youtube,
label: t('dappStaking.modals.community.youtubeAccount'),
validateHandle: (x) => validateUrl(x),
},
{
type: CommunityType.Instagram,
handle: '',
iconUrl: require('src/assets/img/instagram.png'),
iconName: SocialIcon.Instagram,
label: t('dappStaking.modals.community.instagramAccount'),
validateHandle: (x) => validateUrl(x),
},
Expand All @@ -130,10 +131,10 @@ export default defineComponent({
isModalAddCommunity.value = isOpen;
};
const getCommunityIconUrl = (communityType: CommunityType): string => {
const getCommunityIconName = (communityType: CommunityType): string => {
const url = availableCommunities.value.find((x) => x.type === communityType);
return url ? url.iconUrl : 'TODO dummy icon';
return url ? url.iconName : 'TODO dummy icon';
};
const addCommunity = () => {
Expand Down Expand Up @@ -168,7 +169,7 @@ export default defineComponent({
isModalAddCommunity,
availableCommunities,
updateCommunities,
getCommunityIconUrl,
getCommunityIconName,
removeCommunity,
editCommunity,
addCommunity,
Expand Down
5 changes: 3 additions & 2 deletions src/store/dapp-staking/state.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BN } from '@polkadot/util';
import { TvlModel } from 'src/v2/models';
import { DappCombinedInfo, StakerInfo } from 'src/v2/models/DappsStaking';
import { DappCombinedInfo } from 'src/v2/models/DappsStaking';
import { SocialIcon } from '@astar-network/astar-ui';

export type Category = 'defi' | 'gamefi' | 'infra' | 'nft' | 'others';

Expand Down Expand Up @@ -62,7 +63,7 @@ export interface Community {
}

export interface CommunityDefinition extends Community {
iconUrl: string;
iconName: SocialIcon;
label: string;
validateHandle?: (v: string) => boolean | string;
}
Expand Down
144 changes: 72 additions & 72 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
bn.js "^5.2.1"
ethers "^5.6.9"

"@astar-network/astar-ui@^0.0.73":
version "0.0.73"
resolved "https://registry.yarnpkg.com/@astar-network/astar-ui/-/astar-ui-0.0.73.tgz#34e6b53d6969177ce63f810018e09069c186a63d"
integrity sha512-rdWnZNSHExPmS3z/6uEhMOlbM3vMtr8kP8EI2yplV90SBPyekkxCE2vkshLoBzc80V7rc/+x+3mtJHWMcr027A==
"@astar-network/astar-ui@^0.0.74":
version "0.0.74"
resolved "https://registry.yarnpkg.com/@astar-network/astar-ui/-/astar-ui-0.0.74.tgz#69442216b5bb4a117cc9724662babf8ec2353fa8"
integrity sha512-PASStOTIs8tTBKdnYg5cFIBRup8UH9tPQnI00BxI/KWCcaASV/qnbtydAbUsNYE4gZU+MdrZn6LNy9IdoBea+g==
dependencies:
vue "^3.2.23"

Expand Down Expand Up @@ -3967,13 +3967,13 @@
estree-walker "^2.0.2"
source-map "^0.6.1"

"@vue/[email protected].44":
version "3.2.44"
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.44.tgz#9ce3044db28b4b3d5de20cf345ad952f9303e91f"
integrity sha512-TwzeVSnaklb8wIvMtwtkPkt9wnU+XD70xJ7N9+eIHtjKAG7OoZttm+14ZL6vWOL+2RcMtSZ+cYH+gvkUqsrmSQ==
"@vue/[email protected].47":
version "3.2.47"
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.47.tgz#3e07c684d74897ac9aa5922c520741f3029267f8"
integrity sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==
dependencies:
"@babel/parser" "^7.16.4"
"@vue/shared" "3.2.44"
"@vue/shared" "3.2.47"
estree-walker "^2.0.2"
source-map "^0.6.1"

Expand All @@ -3993,13 +3993,13 @@
"@vue/compiler-core" "3.2.37"
"@vue/shared" "3.2.37"

"@vue/[email protected].44":
version "3.2.44"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.44.tgz#0fac337a8a6b3cae586aa8cac62e418aa4c79a83"
integrity sha512-wPDR+gOn2Qi7SudPJ+gE62vuO/aKXIiIFALvHpztXmDdbAHGy3CDfmBgOGchTgTlSeDJHe9olEMkgOdmyXTjUg==
"@vue/[email protected].47":
version "3.2.47"
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.47.tgz#a0b06caf7ef7056939e563dcaa9cbde30794f305"
integrity sha512-dBBnEHEPoftUiS03a4ggEig74J2YBZ2UIeyfpcRM2tavgMWo4bsEfgCGsu+uJIL/vax9S+JztH8NmQerUo7shQ==
dependencies:
"@vue/compiler-core" "3.2.44"
"@vue/shared" "3.2.44"
"@vue/compiler-core" "3.2.47"
"@vue/shared" "3.2.47"

"@vue/[email protected]", "@vue/compiler-sfc@^3.0.0":
version "3.2.22"
Expand Down Expand Up @@ -4033,17 +4033,17 @@
postcss "^8.1.10"
source-map "^0.6.1"

"@vue/[email protected].44":
version "3.2.44"
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.44.tgz#3cc87afdd39d1d9294b45bdd3402ef405d2b0938"
integrity sha512-8cFZcUWlrtnfM/GlRwYJdlfgbEOy0OZ/osLDU3h/wJu24HuYAc7QIML1USaKqiZzkjOaTd4y8mvYvcWXq3o5dA==
"@vue/[email protected].47":
version "3.2.47"
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.47.tgz#1bdc36f6cdc1643f72e2c397eb1a398f5004ad3d"
integrity sha512-rog05W+2IFfxjMcFw10tM9+f7i/+FFpZJJ5XHX72NP9eC2uRD+42M3pYcQqDXVYoj74kHMSEdQ/WmCjt8JFksQ==
dependencies:
"@babel/parser" "^7.16.4"
"@vue/compiler-core" "3.2.44"
"@vue/compiler-dom" "3.2.44"
"@vue/compiler-ssr" "3.2.44"
"@vue/reactivity-transform" "3.2.44"
"@vue/shared" "3.2.44"
"@vue/compiler-core" "3.2.47"
"@vue/compiler-dom" "3.2.47"
"@vue/compiler-ssr" "3.2.47"
"@vue/reactivity-transform" "3.2.47"
"@vue/shared" "3.2.47"
estree-walker "^2.0.2"
magic-string "^0.25.7"
postcss "^8.1.10"
Expand All @@ -4065,13 +4065,13 @@
"@vue/compiler-dom" "3.2.37"
"@vue/shared" "3.2.37"

"@vue/[email protected].44":
version "3.2.44"
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.44.tgz#efba77f4df4ea1727752637764f9d10498daa7df"
integrity sha512-tAkUFLgvxds3l5KPyAH77OIYrEeLngNYQfWA9GocHiy2nlyajjqAH/Jq93Bq29Y20GeJzblmRp9DVYCVkJ5Rsw==
"@vue/[email protected].47":
version "3.2.47"
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.47.tgz#35872c01a273aac4d6070ab9d8da918ab13057ee"
integrity sha512-wVXC+gszhulcMD8wpxMsqSOpvDZ6xKXSVWkf50Guf/S+28hTAXPDYRTbLQ3EDkOP5Xz/+SY37YiwDquKbJOgZw==
dependencies:
"@vue/compiler-dom" "3.2.44"
"@vue/shared" "3.2.44"
"@vue/compiler-dom" "3.2.47"
"@vue/shared" "3.2.47"

"@vue/devtools-api@^6.0.0-beta.11", "@vue/devtools-api@^6.0.0-beta.18", "@vue/devtools-api@^6.0.0-beta.7":
version "6.0.0-beta.20.1"
Expand All @@ -4089,14 +4089,14 @@
estree-walker "^2.0.2"
magic-string "^0.25.7"

"@vue/[email protected].44":
version "3.2.44"
resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.2.44.tgz#dab1175ee8ef1fa7e9d3d9ffe177ed03f70d4021"
integrity sha512-WGbEiXaS2qAOTS9Z3kKk2Nk4bi8OUl73Sih+h0XV9RTUATnaJSEQedveHUDQnHyXiZwyBMKosrxJg8aThHO/rw==
"@vue/[email protected].47":
version "3.2.47"
resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.2.47.tgz#e45df4d06370f8abf29081a16afd25cffba6d84e"
integrity sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==
dependencies:
"@babel/parser" "^7.16.4"
"@vue/compiler-core" "3.2.44"
"@vue/shared" "3.2.44"
"@vue/compiler-core" "3.2.47"
"@vue/shared" "3.2.47"
estree-walker "^2.0.2"
magic-string "^0.25.7"

Expand All @@ -4114,12 +4114,12 @@
dependencies:
"@vue/shared" "3.2.37"

"@vue/[email protected].44":
version "3.2.44"
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.2.44.tgz#f017f9d1557c5fac18feaa3207f247c8a763cf18"
integrity sha512-Fe0s52fTsPl+RSdvoqUZ3HRKlaVsKhIh1mea5EWOedFvZCjnymzlj3YC1wZMxi89qXRFSdEASVA/BWUGypk0Ig==
"@vue/[email protected].47":
version "3.2.47"
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.2.47.tgz#1d6399074eadfc3ed35c727e2fd707d6881140b6"
integrity sha512-7khqQ/75oyyg+N/e+iwV6lpy1f5wq759NdlS1fpAhFXa8VeAIKGgk2E/C4VF59lx5b+Ezs5fpp/5WsRYXQiKxQ==
dependencies:
"@vue/shared" "3.2.44"
"@vue/shared" "3.2.47"

"@vue/[email protected]":
version "3.2.22"
Expand Down Expand Up @@ -4148,13 +4148,13 @@
"@vue/reactivity" "3.2.37"
"@vue/shared" "3.2.37"

"@vue/[email protected].44":
version "3.2.44"
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.2.44.tgz#14abcb1c005873a2d506eaa0bd41726997a82ea1"
integrity sha512-uwEV1cttL33k2dC+CNGYhKEYqGejT9KmgQ+4n/LmYUfZ1Gorl8F32DlIX+1pANyGHL1tBAisqHDxKyQBp2oBNA==
"@vue/[email protected].47":
version "3.2.47"
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.2.47.tgz#406ebade3d5551c00fc6409bbc1eeb10f32e121d"
integrity sha512-RZxbLQIRB/K0ev0K9FXhNbBzT32H9iRtYbaXb0ZIz2usLms/D55dJR2t6cIEUn6vyhS3ALNvNthI+Q95C+NOpA==
dependencies:
"@vue/reactivity" "3.2.44"
"@vue/shared" "3.2.44"
"@vue/reactivity" "3.2.47"
"@vue/shared" "3.2.47"

"@vue/[email protected]":
version "3.2.22"
Expand All @@ -4174,13 +4174,13 @@
"@vue/shared" "3.2.37"
csstype "^2.6.8"

"@vue/[email protected].44":
version "3.2.44"
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.2.44.tgz#0618b3bc99e220c25e1134d4c0da97028458e3af"
integrity sha512-LDzNwXpU/nSpxrLk5jS0bfStgt88msgsgFzj6vHrl7es3QktIrCGybQS5CB/p/TO0q98iAiYtEVmi+Lej7Vgjg==
"@vue/[email protected].47":
version "3.2.47"
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.2.47.tgz#93e760eeaeab84dedfb7c3eaf3ed58d776299382"
integrity sha512-ArXrFTjS6TsDei4qwNvgrdmHtD930KgSKGhS5M+j8QxXrDJYLqYw4RRcDy1bz1m1wMmb6j+zGLifdVHtkXA7gA==
dependencies:
"@vue/runtime-core" "3.2.44"
"@vue/shared" "3.2.44"
"@vue/runtime-core" "3.2.47"
"@vue/shared" "3.2.47"
csstype "^2.6.8"

"@vue/[email protected]":
Expand All @@ -4199,13 +4199,13 @@
"@vue/compiler-ssr" "3.2.37"
"@vue/shared" "3.2.37"

"@vue/[email protected].44":
version "3.2.44"
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.2.44.tgz#efeb4d99e2ff2f71b6ddb512009e6b31bedc8ed5"
integrity sha512-3+ArN07UgOAdbGKIp3uVqeC3bnR3J324QNjPR6vxHbLrTlkibFv8QNled/ux3fVq0KDCkVVKGOKB2V4sCIYOgg==
"@vue/[email protected].47":
version "3.2.47"
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.2.47.tgz#8aa1d1871fc4eb5a7851aa7f741f8f700e6de3c0"
integrity sha512-dN9gc1i8EvmP9RCzvneONXsKfBRgqFeFZLurmHOveL7oH6HiFXJw5OGu294n1nHc/HMgTy6LulU/tv5/A7f/LA==
dependencies:
"@vue/compiler-ssr" "3.2.44"
"@vue/shared" "3.2.44"
"@vue/compiler-ssr" "3.2.47"
"@vue/shared" "3.2.47"

"@vue/[email protected]":
version "3.2.22"
Expand All @@ -4217,10 +4217,10 @@
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.37.tgz#8e6adc3f2759af52f0e85863dfb0b711ecc5c702"
integrity sha512-4rSJemR2NQIo9Klm1vabqWjD8rs/ZaJSzMxkMNeJS6lHiUjjUeYFbooN19NgFjztubEKh3WlZUeOLVdbbUWHsw==

"@vue/[email protected].44":
version "3.2.44"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.44.tgz#d180eae83de86a48a3a0b6aaded546683443ca57"
integrity sha512-mGZ44bnn0zpZ36nXtxbrBPno43yr96wjQE1dBEKS1Sieugt27HS4OGZVBRIgsdGzosB7vqZAvu0ttu1FDVdolA==
"@vue/[email protected].47":
version "3.2.47"
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.47.tgz#e597ef75086c6e896ff5478a6bfc0a7aa4bbd14c"
integrity sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==

"@vue/test-utils@^2.0.0-rc.10":
version "2.0.0-rc.17"
Expand Down Expand Up @@ -15162,15 +15162,15 @@ vue@^3.0.0:
"@vue/shared" "3.2.37"

vue@^3.2.23:
version "3.2.44"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.44.tgz#57581fcc753b8187aae9cf90254f9fa88f7b8ffd"
integrity sha512-nyNtFDh+0TpRgYCUVfPD1mJ9PpIsCPXaOF4DeGNIT5vQ4X23ykflGq3Sy2P+tEt1/pQZxZnAysuRKwyhNj+Cjw==
dependencies:
"@vue/compiler-dom" "3.2.44"
"@vue/compiler-sfc" "3.2.44"
"@vue/runtime-dom" "3.2.44"
"@vue/server-renderer" "3.2.44"
"@vue/shared" "3.2.44"
version "3.2.47"
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.47.tgz#3eb736cbc606fc87038dbba6a154707c8a34cff0"
integrity sha512-60188y/9Dc9WVrAZeUVSDxRQOZ+z+y5nO2ts9jWXSTkMvayiWxCWOWtBQoYjLeccfXkiiPZWAHcV+WTPhkqJHQ==
dependencies:
"@vue/compiler-dom" "3.2.47"
"@vue/compiler-sfc" "3.2.47"
"@vue/runtime-dom" "3.2.47"
"@vue/server-renderer" "3.2.47"
"@vue/shared" "3.2.47"

vuex@^4.0.1:
version "4.0.2"
Expand Down

0 comments on commit 755dcd3

Please sign in to comment.