|
115 | 115 | </div> |
116 | 116 | {/snippet} |
117 | 117 |
|
118 | | -{#if !editing} |
119 | | - {@render display(true)} |
120 | | -{:else} |
121 | | - <div class="edit-outer"> |
122 | | - <div class="edit-grid"> |
123 | | - <label for="repo-label-text">Label text</label> |
124 | | - <TextInput |
125 | | - id="repo-label-text" |
126 | | - bind:value={section.label} |
127 | | - oninput={commitChange} |
128 | | - placeholder={callToAction} |
129 | | - /> |
130 | | - <label for="repo-provider">Repo provider</label> |
131 | | - <Select |
132 | | - id="repo-provider" |
133 | | - bind:value={() => section.info.provider, |
134 | | - (newProvider) => changePackageProvider(newProvider)} |
135 | | - > |
136 | | - <option value="custom">- Custom -</option> |
137 | | - {#each Object.entries(packageProviders) as [provider, info]} |
138 | | - <option value={provider}>{info.name}</option> |
139 | | - {/each} |
140 | | - </Select> |
141 | | - {#if section.info.provider === 'custom'} |
142 | | - <label for="provider-name">Provider name</label> |
143 | | - <TextInput |
144 | | - id="provider-name" |
145 | | - bind:value={section.info.providerName} |
146 | | - oninput={commitChange} |
147 | | - placeholder="Provider name" |
148 | | - required |
149 | | - /> |
150 | | - <label for="install-command">Installation command</label> |
151 | | - <TextInput |
152 | | - id="install-command" |
153 | | - bind:value={section.info.command} |
154 | | - oninput={commitChange} |
155 | | - placeholder="Installation command" |
156 | | - required |
157 | | - /> |
158 | | - <label for="package-url">Package URL</label> |
159 | | - <TextInput |
160 | | - id="package-url" |
161 | | - bind:value={section.info.url} |
162 | | - oninput={commitChange} |
163 | | - placeholder="Package URL" |
164 | | - required |
165 | | - /> |
166 | | - <label for="package-icon">Icon</label> |
| 118 | +<div class="section-main"> |
| 119 | + {#if !editing} |
| 120 | + {@render display(true)} |
| 121 | + {:else} |
| 122 | + <div class="edit-outer"> |
| 123 | + <div class="edit-grid"> |
| 124 | + <label for="repo-label-text">Label text</label> |
167 | 125 | <TextInput |
168 | | - id="package-icon" |
169 | | - bind:value={section.info.command} |
| 126 | + id="repo-label-text" |
| 127 | + bind:value={section.label} |
170 | 128 | oninput={commitChange} |
171 | | - placeholder="Icon" |
| 129 | + placeholder={callToAction} |
172 | 130 | /> |
173 | | - {:else} |
174 | | - <label for="package-id">Package ID</label> |
175 | | - <TextInput |
176 | | - id="package-id" |
177 | | - bind:value={section.info.id} |
178 | | - oninput={commitChange} |
179 | | - placeholder="Package ID" |
180 | | - required |
181 | | - /> |
182 | | - {/if} |
| 131 | + <label for="repo-provider">Repo provider</label> |
| 132 | + <Select |
| 133 | + id="repo-provider" |
| 134 | + bind:value={() => section.info.provider, |
| 135 | + (newProvider) => changePackageProvider(newProvider)} |
| 136 | + > |
| 137 | + <option value="custom">- Custom -</option> |
| 138 | + {#each Object.entries(packageProviders) as [provider, info]} |
| 139 | + <option value={provider}>{info.name}</option> |
| 140 | + {/each} |
| 141 | + </Select> |
| 142 | + {#if section.info.provider === 'custom'} |
| 143 | + <label for="provider-name">Provider name</label> |
| 144 | + <TextInput |
| 145 | + id="provider-name" |
| 146 | + bind:value={section.info.providerName} |
| 147 | + oninput={commitChange} |
| 148 | + placeholder="Provider name" |
| 149 | + required |
| 150 | + /> |
| 151 | + <label for="install-command">Installation command</label> |
| 152 | + <TextInput |
| 153 | + id="install-command" |
| 154 | + bind:value={section.info.command} |
| 155 | + oninput={commitChange} |
| 156 | + placeholder="Installation command" |
| 157 | + required |
| 158 | + /> |
| 159 | + <label for="package-url">Package URL</label> |
| 160 | + <TextInput |
| 161 | + id="package-url" |
| 162 | + bind:value={section.info.url} |
| 163 | + oninput={commitChange} |
| 164 | + placeholder="Package URL" |
| 165 | + required |
| 166 | + /> |
| 167 | + <label for="package-icon">Icon</label> |
| 168 | + <TextInput |
| 169 | + id="package-icon" |
| 170 | + bind:value={section.info.command} |
| 171 | + oninput={commitChange} |
| 172 | + placeholder="Icon" |
| 173 | + /> |
| 174 | + {:else} |
| 175 | + <label for="package-id">Package ID</label> |
| 176 | + <TextInput |
| 177 | + id="package-id" |
| 178 | + bind:value={section.info.id} |
| 179 | + oninput={commitChange} |
| 180 | + placeholder="Package ID" |
| 181 | + required |
| 182 | + /> |
| 183 | + {/if} |
| 184 | + </div> |
| 185 | + <Separator /> |
| 186 | + {@render display(false)} |
183 | 187 | </div> |
184 | | - <Separator /> |
185 | | - {@render display(false)} |
186 | | - </div> |
187 | | -{/if} |
| 188 | + {/if} |
| 189 | +</div> |
188 | 190 |
|
189 | 191 | <style> |
| 192 | + .section-main { |
| 193 | + margin: 10px 0; |
| 194 | + } |
190 | 195 | .display-outer { |
191 | 196 | display: flex; |
192 | 197 | gap: 10px; |
|
0 commit comments