Skip to content

Commit

Permalink
icon for image upload button
Browse files Browse the repository at this point in the history
  • Loading branch information
sapayth committed Nov 25, 2024
1 parent aa9f072 commit 21d19c2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
<div class="wpuf-fields">
<div :id="'wpuf-img_label-' + field.id + '-upload-container'">
<div class="wpuf-attachment-upload-filelist" data-type="file" data-required="yes">
<a :class="builder_class_names('upload_btn')" href="#">
<a
class="wpuf-inline-flex wpuf-items-center wpuf-gap-x-1.5"
:class="builder_class_names('upload_btn')" href="#">
<template v-if="field.button_label === ''">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="wpuf-size-5">
<path d="M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z" />
</svg>
<?php _e( 'Select Image', 'wp-user-frontend' ); ?>
</template>
<template v-else>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="wpuf-size-5">
<path d="M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z" />
</svg>
{{ field.button_label }}
</template>
</a>
Expand Down
12 changes: 10 additions & 2 deletions assets/js-templates/form-components.php
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ class="wpuf-block wpuf-w-full wpuf-min-w-full wpuf-rounded-md wpuf-py-1.5 wpuf-t
<div class="wpuf-fields">
<div :id="'wpuf-img_label-' + field.id + '-upload-container'">
<div class="wpuf-attachment-upload-filelist" data-type="file" data-required="yes">
<a class="wpuf-inline-flex wpuf-items-center wpuf-gap-x-1.5 "
<a class="wpuf-inline-flex wpuf-items-center wpuf-gap-x-1.5"
:class="builder_class_names('upload_btn')" href="#">
<template v-if="field.button_label === ''">
<?php _e( 'Select Image', 'wp-user-frontend' ); ?>
Expand Down Expand Up @@ -836,11 +836,19 @@ class="button"
<div class="wpuf-fields">
<div :id="'wpuf-img_label-' + field.id + '-upload-container'">
<div class="wpuf-attachment-upload-filelist" data-type="file" data-required="yes">
<a :class="builder_class_names('upload_btn')" href="#">
<a
class="wpuf-inline-flex wpuf-items-center wpuf-gap-x-1.5"
:class="builder_class_names('upload_btn')" href="#">
<template v-if="field.button_label === ''">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="wpuf-size-5">
<path d="M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z" />
</svg>
<?php _e( 'Select Image', 'wp-user-frontend' ); ?>
</template>
<template v-else>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="wpuf-size-5">
<path d="M8.75 3.75a.75.75 0 0 0-1.5 0v3.5h-3.5a.75.75 0 0 0 0 1.5h3.5v3.5a.75.75 0 0 0 1.5 0v-3.5h3.5a.75.75 0 0 0 0-1.5h-3.5v-3.5Z" />
</svg>
{{ field.button_label }}
</template>
</a>
Expand Down

0 comments on commit 21d19c2

Please sign in to comment.