Refactor profile index.blade.php to improve OTP display and functionality
This commit is contained in:
		@@ -50,19 +50,17 @@
 | 
				
			|||||||
                    copiedSecretKey: false,
 | 
					                    copiedSecretKey: false,
 | 
				
			||||||
                    copiedOtpUrl: false
 | 
					                    copiedOtpUrl: false
 | 
				
			||||||
                }" class="py-4 w-full">
 | 
					                }" class="py-4 w-full">
 | 
				
			||||||
                    <div class="flex flex-col gap-2">
 | 
					                    <div class="flex flex-col gap-2" x-show="showCode">
 | 
				
			||||||
                        <div class="relative">
 | 
					                        <div class="relative">
 | 
				
			||||||
                            <x-forms.input
 | 
					                            <x-forms.input
 | 
				
			||||||
                                x-show="showCode" 
 | 
					 | 
				
			||||||
                                x-model="secretKey"
 | 
					                                x-model="secretKey"
 | 
				
			||||||
                                label="Secret Key"
 | 
					                                label="Secret Key"
 | 
				
			||||||
                                readonly
 | 
					                                readonly
 | 
				
			||||||
                                class="font-mono pr-10"
 | 
					                                class="font-mono pr-10"
 | 
				
			||||||
                            />
 | 
					                            />
 | 
				
			||||||
                            <button
 | 
					                            <button
 | 
				
			||||||
                                x-show="showCode"
 | 
					 | 
				
			||||||
                                @click="navigator.clipboard.writeText(secretKey); copiedSecretKey = true; setTimeout(() => copiedSecretKey = false, 2000)"
 | 
					                                @click="navigator.clipboard.writeText(secretKey); copiedSecretKey = true; setTimeout(() => copiedSecretKey = false, 2000)"
 | 
				
			||||||
                                class="absolute right-2 bottom-2 p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-700"
 | 
					                                class="absolute right-2 bottom-1 p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-700"
 | 
				
			||||||
                            >
 | 
					                            >
 | 
				
			||||||
                                <svg x-show="!copiedSecretKey" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
 | 
					                                <svg x-show="!copiedSecretKey" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
 | 
				
			||||||
                                    <path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75" />
 | 
					                                    <path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75" />
 | 
				
			||||||
@@ -74,16 +72,14 @@
 | 
				
			|||||||
                        </div>
 | 
					                        </div>
 | 
				
			||||||
                        <div class="relative" >
 | 
					                        <div class="relative" >
 | 
				
			||||||
                            <x-forms.input
 | 
					                            <x-forms.input
 | 
				
			||||||
                                x-show="showCode" 
 | 
					 | 
				
			||||||
                                x-model="otpUrl"
 | 
					                                x-model="otpUrl"
 | 
				
			||||||
                                label="OTP URL"
 | 
					                                label="OTP URL"
 | 
				
			||||||
                                readonly
 | 
					                                readonly
 | 
				
			||||||
                                class="font-mono pr-10"
 | 
					                                class="font-mono pr-10"
 | 
				
			||||||
                            />
 | 
					                            />
 | 
				
			||||||
                            <button
 | 
					                            <button
 | 
				
			||||||
                                x-show="showCode"
 | 
					 | 
				
			||||||
                                @click="navigator.clipboard.writeText(otpUrl); copiedOtpUrl = true; setTimeout(() => copiedOtpUrl = false, 2000)"
 | 
					                                @click="navigator.clipboard.writeText(otpUrl); copiedOtpUrl = true; setTimeout(() => copiedOtpUrl = false, 2000)"
 | 
				
			||||||
                                class="absolute right-2 bottom-2 p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-700"
 | 
					                                class="absolute right-2 bottom-1 p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-700"
 | 
				
			||||||
                            >
 | 
					                            >
 | 
				
			||||||
                                <svg x-show="!copiedOtpUrl" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
 | 
					                                <svg x-show="!copiedOtpUrl" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
 | 
				
			||||||
                                    <path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75" />
 | 
					                                    <path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75" />
 | 
				
			||||||
@@ -95,7 +91,7 @@
 | 
				
			|||||||
                        </div>
 | 
					                        </div>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                    <x-forms.button x-on:click="showCode = !showCode" class="mt-2">
 | 
					                    <x-forms.button x-on:click="showCode = !showCode" class="mt-2">
 | 
				
			||||||
                        <span x-text="showCode ? 'Hide' : 'Show'"></span> Secret Key and OTP URL
 | 
					                        <span x-text="showCode ? 'Hide Secret Key and OTP URL' : 'Show Secret Key and OTP URL'"></span>
 | 
				
			||||||
                    </x-forms.button>
 | 
					                    </x-forms.button>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user