@@ -43,6 +43,7 @@ const repliesQuery = useReplies({ hash });
4343const POST_HASH_LEN = 64 ;
4444const MAX_CHARS = 512 - (' dither.Reply("", "")' .length + POST_HASH_LEN );
4545const reply = ref (' ' );
46+ const showReply = ref (false );
4647const isBalanceInputValid = ref (false );
4748const inputPhotonModel = ref (Decimal .fromAtomics (' 1' , fractionalDigits ).toFloatApproximation ());
4849const configStore = useConfigStore ();
@@ -100,30 +101,37 @@ async function handleReply() {
100101
101102 <!-- Transaction Form -->
102103 <div v-if =" wallet.loggedIn.value" class =" flex flex-col gap-4 mt-4" >
103- <div v-if =" isDefaultAmountInvalid" class =" flex flex-col items-right gap-4" >
104- <span class =" text-sm whitespace-pre-line" >{{ $t('components.PostView.invalidDefaultAmount') }}</span >
105- <Button size =" sm" @click =" router.push({ name: routesNames.settingsDefaultAmount });" class =" ml-auto" >
106- {{ $t('components.Button.adjustDefaultAmount') }}
107- </Button >
108- </div >
109-
110- <template v-else >
111- <div class =" flex flex-row item-center" >
112- <UserAvatar :userAddress =" wallet.address.value" disabled />
113- <Textarea :placeholder =" $t('placeholders.reply')" v-model =" reply" :maxlength =" MAX_CHARS" class =" ml-1 mt-1" />
114- </div >
115-
116- <div class =" flex flex-row gap-4" >
117- <InputPhoton v-if =" !configStore.config.defaultAmountEnabled" v-model =" inputPhotonModel" @on-validity-change =" handleInputValidity" />
118- <Button size =" sm" :disabled =" !canReply" @click =" handleReply" class =" ml-auto" >
119- {{ $t('components.Button.reply') }}
104+ <template v-if =" showReply " >
105+ <div v-if =" isDefaultAmountInvalid" class =" flex flex-col items-right gap-4" >
106+ <span class =" text-sm whitespace-pre-line" >{{ $t('components.PostView.invalidDefaultAmount') }}</span >
107+ <Button size =" sm" @click =" router.push({ name: routesNames.settingsDefaultAmount });" class =" ml-auto" >
108+ {{ $t('components.Button.adjustDefaultAmount') }}
120109 </Button >
121110 </div >
111+
112+ <template v-else >
113+ <div class =" flex flex-row item-center" >
114+ <UserAvatar :userAddress =" wallet.address.value" disabled />
115+ <Textarea :placeholder =" $t('placeholders.reply')" v-model =" reply" :maxlength =" MAX_CHARS" class =" ml-1 mt-1" />
116+ </div >
117+
118+ <div class =" flex flex-row gap-4" >
119+ <InputPhoton v-if =" !configStore.config.defaultAmountEnabled" v-model =" inputPhotonModel" @on-validity-change =" handleInputValidity" />
120+ <Button size =" sm" :disabled =" !canReply" @click =" handleReply" class =" ml-auto" >
121+ {{ $t('components.Button.reply') }}
122+ </Button >
123+ </div >
124+ </template >
122125 </template >
123126 </div >
124127 </div >
125128 </div >
126-
129+ <div class =" flex flex-row p-3 border-t border-gray-200 items-center justify-between" >
130+ <div class =" text-lg font-semibold" >Replies</div >
131+ <Button size =" sm" @click =" showReply = !showReply" v-if =" wallet.loggedIn.value" class =" ml-auto" >
132+ {{ showReply ? $t('components.Button.closeReply') : $t('components.Button.createReply') }}
133+ </Button >
134+ </div >
127135 <!-- Replies posts list -->
128136 <PostsList :query =" repliesQuery" hideEmptyText />
129137 </MainLayout >
0 commit comments