Skip to content

Commit 4c58419

Browse files
committed
social styling to match profilepane
1 parent 03291fe commit 4c58419

7 files changed

Lines changed: 702 additions & 167 deletions

File tree

src/social/editProfileDetails.ts

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ type EditProfileDetailsButtonOptions = {
2626
dom: HTMLDocument
2727
store: LiveStore
2828
subject: NamedNode
29-
header: HTMLElement
3029
onSaved: () => void
3130
}
3231

@@ -190,24 +189,26 @@ export function appendProfileLinks (
190189

191190
export function createEditProfileDetailsButton (
192191
options: EditProfileDetailsButtonOptions
193-
): HTMLButtonElement {
194-
const { dom, store, subject, header, onSaved } = options
195-
const button = dom.createElement('button')
192+
): HTMLElement {
193+
const { dom, store, subject, onSaved } = options
194+
const button = dom.createElement('solid-ui-button')
196195
button.type = 'button'
197-
button.className = 'social-pane__edit-button'
196+
button.className = 'social-pane__edit-button profile__action-button profile__heading-action-button profile-action-text flex-center profile-section-collapsible__edit-button'
197+
button.variant = 'secondary'
198+
button.size = 'sm'
199+
200+
const label = dom.createElement('span')
201+
label.className = 'profile-section-collapsible__edit-label social-pane__edit-button-label'
202+
label.innerHTML = `${editIcon} Edit`
203+
button.appendChild(label)
198204

199205
const icon = dom.createElement('span')
200-
icon.className = 'social-pane__edit-button-icon'
206+
icon.className = 'profile-section-collapsible__edit-icon social-pane__edit-button-icon'
207+
icon.setAttribute('aria-hidden', 'true')
201208
icon.innerHTML = editIcon
202209
button.appendChild(icon)
203210

204-
const label = dom.createElement('span')
205-
label.className = 'social-pane__edit-button-label'
206-
label.textContent = 'Edit'
207-
button.appendChild(label)
208-
209211
button.setAttribute('aria-label', 'Edit profile links')
210-
header.style.position = 'relative'
211212

212213
const openDialog = () => {
213214
const initialValues = readProfileLinkValues(store, subject)
@@ -281,16 +282,26 @@ export function createEditProfileDetailsButton (
281282
fieldLabel.textContent = field.label
282283
fieldHeader.appendChild(fieldLabel)
283284

284-
const addButton = dom.createElement('button')
285+
const addButton = dom.createElement('solid-ui-button')
285286
addButton.type = 'button'
286-
addButton.className = 'social-pane__dialog-row-button social-pane__dialog-row-button--add'
287+
addButton.className = 'social-pane__dialog-row-button--add'
287288
addButton.setAttribute('aria-label', `Add another ${field.label.toLowerCase()}`)
289+
addButton.variant = 'secondary'
290+
addButton.size = 'sm'
291+
const addButtonContent = dom.createElement('span')
292+
addButtonContent.className = 'social-pane__add-more-content'
293+
const addButtonInline = dom.createElement('span')
294+
addButtonInline.className = 'social-pane__add-more-inline'
288295
const addButtonIcon = dom.createElement('span')
289-
addButtonIcon.className = 'social-pane__dialog-row-button-icon social-pane__dialog-row-button-icon--add'
296+
addButtonIcon.className = 'social-pane__add-more-icon'
290297
addButtonIcon.setAttribute('aria-hidden', 'true')
291298
addButtonIcon.innerHTML = plusIcon
292-
addButton.appendChild(addButtonIcon)
293-
addButton.appendChild(dom.createTextNode('Add More'))
299+
const addButtonText = dom.createElement('span')
300+
addButtonText.textContent = 'Add More'
301+
addButtonInline.appendChild(addButtonIcon)
302+
addButtonInline.appendChild(addButtonText)
303+
addButtonContent.appendChild(addButtonInline)
304+
addButton.appendChild(addButtonContent)
294305
addButton.addEventListener('click', () => {
295306
formState[field.key].push('')
296307
renderFields({ fieldKey: field.key, rowIndex: formState[field.key].length - 1 })
@@ -324,7 +335,7 @@ export function createEditProfileDetailsButton (
324335
removeButton.setAttribute('aria-label', `Remove ${field.label.toLowerCase()} ${index + 1}`)
325336
removeButton.setAttribute('title', 'Remove')
326337
removeButton.variant = 'icon'
327-
removeButton.size = 'sm'
338+
removeButton.size = 'md'
328339
const removeButtonIcon = dom.createElement('span')
329340
removeButtonIcon.className = 'social-pane__dialog-row-button-icon social-pane__dialog-row-button-icon--remove'
330341
removeButtonIcon.setAttribute('slot', 'icon')

src/social/icons.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export const personInCircleIcon = html`
1818
`
1919
export const editIcon = html`
2020
<svg xmlns="http://www.w3.org/2000/svg"
21-
width="20"
22-
height="20"
23-
viewBox="0 0 20 20"
21+
width="14"
22+
height="14"
23+
viewBox="3 3 14 14"
2424
fill="none"
2525
aria-hidden="true"
2626
focusable="false"

0 commit comments

Comments
 (0)