iachat/app/javascript/dashboard/routes/dashboard/settings/profile/UserProfilePicture.vue
Muhsin Keloth 2af0d58deb
feat: Revamp profile settings screen (#9352)
Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
Co-authored-by: iamsivin <iamsivin@gmail.com>
2024-05-06 22:33:39 +05:30

41 lines
882 B
Vue

<template>
<div class="flex flex-col gap-2">
<span class="text-sm font-medium text-ash-900">
{{ $t('PROFILE_SETTINGS.FORM.PICTURE') }}
</span>
<profile-avatar
:src="src"
:name="userNameWithoutEmoji"
@change="updateProfilePicture"
@delete="deleteProfilePicture"
/>
</div>
</template>
<script setup>
import { computed } from 'vue';
import ProfileAvatar from 'v3/components/Form/ProfileAvatar.vue';
import { removeEmoji } from 'shared/helpers/emoji';
const props = defineProps({
src: {
type: String,
default: '',
},
name: {
type: String,
default: '',
},
});
const emits = defineEmits(['change', 'delete']);
const userNameWithoutEmoji = computed(() => removeEmoji(props.name));
const updateProfilePicture = e => {
emits('change', e);
};
const deleteProfilePicture = () => {
emits('delete');
};
</script>