Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit 6f87c5a

Browse files
committed
feat(wip): rename profile to character
waiting for unidata
1 parent 681e1ba commit 6f87c5a

15 files changed

Lines changed: 106 additions & 105 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ CrossSync is a socially-oriented web3 Dapp that runs on the Crossbell. CrossSync
2525

2626
Crossbell allows users the ability to take back their data ownership; CrossSync makes owning your data a fun and engaging social experience.
2727

28-
To get started, you’ll need go to [Crossbell Faucet](https://faucet.crossbell.io) and get some $CSB. After you’ve connected your wallet and received the $CSB, you’ll be able to mint a profile on CrossSync.
28+
To get started, you’ll need go to [Crossbell Faucet](https://faucet.crossbell.io) and get some $CSB. After you’ve connected your wallet and received the $CSB, you’ll be able to mint a character on CrossSync.
2929

3030
## 🪙 Special
3131

components.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ declare module '@vue/runtime-core' {
1616
Header: typeof import('./src/components/Header.vue')['default']
1717
InfiniteScroll: typeof import('element-plus/es')['ElInfiniteScroll']
1818
Loading: typeof import('element-plus/es')['ElLoadingDirective']
19-
Profiles: typeof import('./src/components/Profiles.vue')['default']
19+
Characters: typeof import('./src/components/Characters.vue')['default']
2020
RouterLink: typeof import('vue-router')['RouterLink']
2121
RouterView: typeof import('vue-router')['RouterView']
2222
Sidebar: typeof import('./src/components/Sidebar.vue')['default']

src/common/router.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createRouter, createWebHashHistory } from 'vue-router';
33
import IndexPage from '../pages/Index.vue';
44
import IndexRootPage from '../pages/IndexRoot.vue';
55
import MintPage from '../pages/Mint.vue';
6-
import ProfilesPage from '../pages/Profiles.vue';
6+
import CharactersPage from '../pages/Characters.vue';
77
import FaucetPage from '../pages/Faucet.vue';
88
import HomePage from '../pages/Home.vue';
99
import HomeRootPage from '../pages/HomeRoot.vue';
@@ -27,8 +27,8 @@ export const router = createRouter({
2727
component: MintPage,
2828
},
2929
{
30-
path: 'profiles',
31-
component: ProfilesPage,
30+
path: 'characters',
31+
component: CharactersPage,
3232
},
3333
{
3434
path: 'faucet',

src/common/store.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const getSettings = async (): Promise<Settings> =>
2323
const settings = await getSettings();
2424

2525
interface State {
26-
profiles?: Profiles;
26+
characters?: Characters;
2727
settings: Settings;
2828
}
2929

@@ -32,9 +32,9 @@ export const key: InjectionKey<Store<State>> = Symbol();
3232
export const store = createStore<State>({
3333
state: {
3434
settings: settings,
35-
profiles: settings.address
36-
? await new Unidata().profiles.get({
37-
source: 'Crossbell Profile',
35+
characters: settings.address
36+
? await new Unidata().characters.get({
37+
source: 'Crossbell Character',
3838
identity: settings.address,
3939
})
4040
: undefined,
@@ -43,8 +43,8 @@ export const store = createStore<State>({
4343
actions: {
4444
async setSettings({ state }, settings: Partial<Settings>) {
4545
if (settings.address && settings.address !== state.settings.address) {
46-
state.profiles = await window.unidata!.profiles.get({
47-
source: 'Crossbell Profile',
46+
state.characters = await window.unidata!.characters.get({
47+
source: 'Crossbell Character',
4848
identity: settings.address,
4949
});
5050
}
@@ -54,7 +54,7 @@ export const store = createStore<State>({
5454
},
5555
async reset({ state }) {
5656
await disconnect();
57-
state.profiles = undefined;
57+
state.characters = undefined;
5858
state.settings = {
5959
syncing: true,
6060
};
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<template>
2-
<el-card class="relative" :class="size === 'mini' ? ['inline-flex', 'mr-4', 'profile-mini'] : []" shadow="hover">
2+
<el-card class="relative" :class="size === 'mini' ? ['inline-flex', 'mr-4', 'character-mini'] : []" shadow="hover">
33
<div class="info flex relative content-center items-center">
4-
<div :class="size === 'mini' ? ['w-10', 'h-10', 'mr-2'] : ['w-20', 'h-20', 'mr-5']" v-if="profile.avatars">
5-
<img class="rounded-full" :src="profile.avatars?.[0]" />
4+
<div
5+
:class="size === 'mini' ? ['w-10', 'h-10', 'mr-2'] : ['w-20', 'h-20', 'mr-5']"
6+
v-if="character.avatars"
7+
>
8+
<img class="rounded-full" :src="character.avatars?.[0]" />
69
</div>
710
<div class="flex content-center flex-col">
811
<div
@@ -11,7 +14,7 @@
1114
size === 'small' ? ['text-xl', 'line-clamp-1'] : size === 'mini' ? [] : ['text-2xl', 'mb-1']
1215
"
1316
>
14-
{{ profile.name || profile.username }}
17+
{{ character.name || character.username }}
1518
<span
1619
class="username text-sm text-gray-500"
1720
:class="
@@ -21,16 +24,16 @@
2124
? ['block', 'text-xs']
2225
: ['text-sm', 'ml-1']
2326
"
24-
v-if="profile.username"
25-
>@{{ profile.username }}</span
27+
v-if="character.username"
28+
>@{{ character.username }}</span
2629
>
2730
</div>
2831
<div
2932
class="text-sm text-gray-400"
30-
v-if="profile.bio && size !== 'mini'"
33+
v-if="character.bio && size !== 'mini'"
3134
:class="size === 'small' ? ['line-clamp-3'] : []"
3235
>
33-
{{ profile.bio }}
36+
{{ character.bio }}
3437
</div>
3538
</div>
3639
</div>
@@ -39,7 +42,7 @@
3942

4043
<script setup lang="ts">
4144
const props = defineProps({
42-
profile: {
45+
character: {
4346
type: Object,
4447
required: true,
4548
},
@@ -48,11 +51,11 @@ const props = defineProps({
4851
},
4952
});
5053
51-
// const profile = ref(props.profile);
54+
// const character = ref(props.character);
5255
</script>
5356

5457
<style lang="less">
55-
.profile-mini .el-card__body {
58+
.character-mini .el-card__body {
5659
@apply p-4;
5760
}
5861
</style>

src/components/Notes.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<template>
22
<el-card class="relative border-0 hover:bg-gray-100" shadow="never">
33
<div class="flex flex-row">
4-
<div class="w-10 h-10 mr-3" v-if="profile.avatars?.[0]">
5-
<img class="rounded-full" :src="profile.avatars?.[0]" />
4+
<div class="w-10 h-10 mr-3" v-if="character.avatars?.[0]">
5+
<img class="rounded-full" :src="character.avatars?.[0]" />
66
</div>
77
<div class="flex-1">
88
<div class="mb-1">
9-
<span class="font-bold align-middle">{{ profile.name || profile.username }}</span>
10-
<span class="text-gray-500 ml-1 align-middle" v-if="profile.username">@{{ profile.username }}</span>
9+
<span class="font-bold align-middle">{{ character.name || character.username }}</span>
10+
<span class="text-gray-500 ml-1 align-middle" v-if="character.username"
11+
>@{{ character.username }}</span
12+
>
1113
<span class="text-gray-500 ml-1 align-middle"
1214
>· {{ moment.duration(moment().diff(note.date_created)).humanize() }} ·
1315
</span>
@@ -98,14 +100,14 @@ const props = defineProps({
98100
type: Object,
99101
required: true,
100102
},
101-
profile: {
103+
character: {
102104
type: Object,
103105
required: true,
104106
},
105107
});
106108
107109
const note = props.note;
108-
const profile = props.profile;
110+
const character = props.character;
109111
110112
const getHost = (url: string) => {
111113
try {

src/components/Sidebar.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
22
<div class="w-80 mr-12 min-h-full pt-28 flex flex-col relative">
33
<Header />
4-
<Profile
4+
<Character
55
class="mb-0 rounded-br-none cursor-pointer border-0"
6-
:profile="profile"
7-
@click="profileClick"
6+
:character="character"
7+
@click="characterClick"
88
size="small"
99
/>
1010
<el-card shadow="hover" class="cursor-pointer mt-4 border-0" @click="settingsClick">
@@ -21,17 +21,17 @@
2121
</template>
2222
<script setup lang="ts">
2323
import { ref } from 'vue';
24-
import Profile from '@/components/Profiles.vue';
24+
import Character from '@/components/Characters.vue';
2525
import { useRouter } from 'vue-router';
2626
import { useStore } from '@/common/store';
2727
import Header from '@/components/Header.vue';
2828
2929
const router = useRouter();
3030
const store = useStore();
3131
32-
const profile = ref<any>({});
32+
const character = ref<any>({});
3333
34-
const profileClick = () => {
34+
const characterClick = () => {
3535
router.push('/home');
3636
};
3737
@@ -43,9 +43,9 @@ const helpClick = () => {
4343
router.push('/home/help');
4444
};
4545
46-
profile.value =
47-
store.state.profiles!.list.find((profile) => profile.username === store.state.settings.handle) ||
48-
store.state.profiles!.list[0]; // As a fallback, use the first profile
46+
character.value =
47+
store.state.characters!.list.find((character) => character.username === store.state.settings.handle) ||
48+
store.state.characters!.list[0]; // As a fallback, use the first character
4949
</script>
5050

5151
<style scoped>
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<template>
22
<div v-loading="loading" class="py-5">
3-
<h2 class="text-4xl font-bold my-5">Choose Your Profile</h2>
3+
<h2 class="text-4xl font-bold my-5">Choose Your Character</h2>
44
<p>
55
<span class="align-middle"
66
>You are logged in as <b>{{ address }}</b>
77
</span>
88
<el-button class="align-middle ml-2" text bg type="primary" @click="switchAccount"
99
>switch account</el-button
1010
>
11-
<span class="align-middle"> , you have {{ profiles.length }} profiles, choose one to continue</span>
11+
<span class="align-middle"> , you have {{ characters.length }} characters, choose one to continue</span>
1212
</p>
13-
<ProfileCard
14-
class="profile mt-4 cursor-pointer mb-5"
15-
v-for="profile in profiles"
16-
:profile="profile"
17-
:key="profile.username"
18-
@click="choose(profile)"
13+
<CharacterCard
14+
class="character mt-4 cursor-pointer mb-5"
15+
v-for="character in characters"
16+
:character="character"
17+
:key="character.username"
18+
@click="choose(character)"
1919
/>
2020
<el-card class="relative cursor-pointer font-bold text-center" shadow="hover" @click="router.push('/mint')">
2121
+ Mint Another One
@@ -24,7 +24,7 @@
2424
</template>
2525

2626
<script setup lang="ts">
27-
import ProfileCard from '@/components/Profiles.vue';
27+
import CharacterCard from '@/components/Characters.vue';
2828
import { useRouter } from 'vue-router';
2929
import { useStore } from '@/common/store';
3030
import { ref } from 'vue';
@@ -33,7 +33,7 @@ const router = useRouter();
3333
const store = useStore();
3434
3535
if (store.state.settings.address) {
36-
if (!store.state.profiles?.list.length) {
36+
if (!store.state.characters?.list.length) {
3737
router.push('/mint');
3838
}
3939
} else {
@@ -43,10 +43,10 @@ if (store.state.settings.address) {
4343
const address = `${store.state.settings.address!.slice(0, 6)}...${store.state.settings.address!.slice(-4)}`;
4444
const loading = ref(false);
4545
46-
const choose = async (profile: Profile) => {
46+
const choose = async (character: Character) => {
4747
loading.value = true;
4848
await store.dispatch('setSettings', {
49-
handle: profile.username,
49+
handle: character.username,
5050
});
5151
loading.value = false;
5252
await router.push('/home');
@@ -57,11 +57,11 @@ const switchAccount = async () => {
5757
await router.push('/');
5858
};
5959
60-
const profiles = store.state.profiles?.list || [];
60+
const characters = store.state.characters?.list || [];
6161
</script>
6262

6363
<style>
64-
.profile {
64+
.character {
6565
width: 738px;
6666
}
6767
</style>

src/pages/Faucet.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ const toFaucet = () => {
3232
};
3333
3434
const next = () => {
35-
if (!store.state.profiles?.list.length) {
35+
if (!store.state.characters?.list.length) {
3636
router.push('/mint');
3737
} else if (!store.state.settings.handle) {
38-
router.push('/profiles');
38+
router.push('/characters');
3939
} else {
4040
router.push('/home');
4141
}

src/pages/Help.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="flex flex-col">
55
<p class="leading-7 my-3 text-gray-700">
66
CrossSync is a socially-oriented web3 Dapp that runs on the Crossbell. CrossSync aims to allow a
7-
user-owned flow of social information, including but not limited to: following other user profiles,
7+
user-owned flow of social information, including but not limited to: following other user characters,
88
integrated Twitter UI, note-posting, achievement badges, and more.
99
</p>
1010
<p class="leading-7 my-3 text-gray-700">
@@ -14,7 +14,7 @@
1414
<p class="leading-7 my-3 text-gray-700">
1515
To get started, you’ll need go to
1616
<a class="underline" href="https://faucet.crossbell.io">faucet.crossbell.io</a> and get some $CSB. After
17-
you’ve connected your wallet and received the $CSB, you’ll be able to mint a profile on CrossSync.
17+
you’ve connected your wallet and received the $CSB, you’ll be able to mint a character on CrossSync.
1818
</p>
1919
</div>
2020
</div>
@@ -28,10 +28,10 @@ const router = useRouter();
2828
const store = useStore();
2929
3030
if (store.state.settings.address) {
31-
if (!store.state.profiles?.list.length) {
31+
if (!store.state.characters?.list.length) {
3232
router.push('/mint');
3333
} else if (!store.state.settings.handle) {
34-
router.push('/profiles');
34+
router.push('/characters');
3535
}
3636
} else {
3737
router.push('/');

0 commit comments

Comments
 (0)