Commit f288a750 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix: typo in EpisodeController remap function to get episode

- fix defaultValue being empty string when cast as array
- fix initial styles for select to reduce
content layout shift
parent 7e8f0003
Loading
Loading
Loading
Loading
+7 −15
Original line number Diff line number Diff line
@@ -35,10 +35,6 @@
    cursor: pointer;
  }

  .choices[data-type*="select-one"] .choices__inner {
    padding-bottom: 7.5px;
  }

  .choices[data-type*="select-one"] .choices__input {
    display: block;
    width: 100%;
@@ -119,7 +115,7 @@
    display: inline-block;
    margin-left: 8px;
    padding-left: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z'/%3E%3C/svg%3E");
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300574B'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z'/%3E%3C/svg%3E");
    background-size: 16px;
    width: 8px;
    line-height: 1;
@@ -135,7 +131,7 @@
  }

  .choices__inner {
    @apply p-2 rounded-lg border-contrast bg-elevated border-3;
    @apply px-3 py-2 rounded-lg border-contrast bg-elevated border-3 transition;

    box-shadow: 2px 2px 0 hsl(var(--color-border-contrast));
    display: inline-block;
@@ -146,13 +142,9 @@
    overflow: hidden;
  }

  .choices[data-type*="select-multiple"] .choices__inner {
    @apply pb-1;
  }

  .is-focused .choices__inner,
  .is-open .choices__inner {
    @apply ring-accent ring-inset;
    @apply ring-accent;
  }

  .is-open .choices__inner {
@@ -183,11 +175,11 @@
  }

  .choices__list--multiple {
    display: inline;
    @apply inline-flex gap-2 mr-2 items-center;
  }

  .choices__list--multiple .choices__item {
    @apply inline-block px-2 py-1 mb-1 mr-1 text-sm align-middle rounded text-accent-contrast bg-accent-base;
    @apply inline-block font-semibold px-1 py-0.5 text-sm align-middle rounded text-accent-hover bg-base border-accent-base ring-2 ring-accent-base;

    word-break: break-all;
    box-sizing: border-box;
@@ -203,7 +195,7 @@
  }

  .choices__list--multiple .choices__item.is-highlighted {
    @apply bg-accent-base;
    @apply bg-subtle;
  }

  .is-disabled .choices__list--multiple .choices__item {
@@ -329,7 +321,7 @@
  }

  .choices__input {
    @apply mb-1 align-middle bg-elevated;
    @apply align-middle bg-elevated;

    display: inline-block;
    font-size: 14px;
+4 −0
Original line number Diff line number Diff line
@@ -6,6 +6,10 @@
  .form-helper {
    @apply text-skin-muted;
  }

  select {
    box-shadow: 2px 2px 0 hsl(var(--color-border-contrast));
  }
}

@layer components {
+2 −2
Original line number Diff line number Diff line
@@ -32,9 +32,9 @@ abstract class FormComponent extends Component
    protected string|array|null $value = null;

    /**
     * @var string|string[]
     * @var string|string[]|null
     */
    protected string|array $defaultValue = '';
    protected string|array|null $defaultValue = null;

    protected bool $isRequired = false;

+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ class Input extends FormComponent
        $this->mergeClass('w-full border-contrast rounded-lg focus:border-contrast border-3 focus-within:ring-accent transition');

        if ($this->type === 'file') {
            $this->mergeClass('file:px-3 file:py-2 file:h-[40px] file:font-semibold file:text-skin-muted file:text-sm file:rounded-none file:border-none file:bg-highlight file:cursor-pointer');
            $this->mergeClass('file:px-3 file:py-2 file:h-[40px] file:font-semibold file:text-accent-hover file:text-sm file:rounded-none file:border-none file:bg-base file:cursor-pointer');
        } else {
            $this->mergeClass('px-3 py-2');
        }
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ class EpisodeController extends BaseController
        }

        if (
            ! ($episode = (new EpisodeModel())->getEpisodeById((int) $params[1]) instanceof Episode)
            ! ($episode = (new EpisodeModel())->getEpisodeById((int) $params[1])) instanceof Episode
        ) {
            throw PageNotFoundException::forPageNotFound();
        }
Loading