Skip to content

Commit 447a60e

Browse files
committed
Hide legacy social header controls
1 parent 1821d62 commit 447a60e

2 files changed

Lines changed: 9 additions & 46 deletions

File tree

src/social/editProfileDetails.ts

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,6 @@ function normalizeUrlList (values: string[], fieldLabel: string): string[] {
112112
return [...unique]
113113
}
114114

115-
function formatDisplayUrl (value: string): string {
116-
let displayValue = value.replace(/^https?:\/\//i, '')
117-
if (/^[^/?#]+\/$/.test(displayValue)) {
118-
displayValue = displayValue.slice(0, -1)
119-
}
120-
return displayValue
121-
}
122-
123115
async function saveProfileLinkValues (
124116
store: LiveStore,
125117
subject: NamedNode,
@@ -175,38 +167,13 @@ async function saveProfileLinkValues (
175167
}
176168

177169
export function appendProfileLinks (
178-
container: HTMLElement,
179-
dom: HTMLDocument,
180-
store: LiveStore,
181-
subject: NamedNode
170+
_container: HTMLElement,
171+
_dom: HTMLDocument,
172+
_store: LiveStore,
173+
_subject: NamedNode
182174
): void {
183-
const webLinksSection = dom.createElement('section')
184-
webLinksSection.className = 'social-profile-links'
185-
container.appendChild(webLinksSection)
186-
for (const field of profileLinkFields) {
187-
const statements = store.statementsMatching(subject, field.predicate)
188-
if (statements.length === 0) continue
189-
190-
const uris = statements
191-
.map((statement) => statement.object?.value || '')
192-
.filter(Boolean)
193-
.sort()
194-
195-
let previousUri = ''
196-
for (const uri of uris) {
197-
if (uri === previousUri) continue
198-
previousUri = uri
199-
const anchor = dom.createElement('a')
200-
anchor.textContent = formatDisplayUrl(uri)
201-
anchor.setAttribute('href', uri)
202-
anchor.setAttribute('title', `${field.label}: ${uri}`)
203-
204-
const item = dom.createElement('div')
205-
item.className = 'social-pane__link-button'
206-
item.appendChild(anchor)
207-
webLinksSection.appendChild(item)
208-
}
209-
}
175+
// Hidden for now because social-pane website links are not part of the new design.
176+
// Revisit later if we decide to show profile links in this header again.
210177
}
211178

212179
export function createEditProfileDetailsButton (

src/social/socialSections.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { DataBrowserContext } from 'pane-registry'
22
import { createAddMeToYourFriendsButton } from 'profile-pane'
33
import { Statement, NamedNode } from 'rdflib'
44
import { ns, utils, widgets } from 'solid-ui'
5-
import { appendProfileLinks, createEditProfileDetailsButton } from './editProfileDetails'
5+
import { appendProfileLinks } from './editProfileDetails'
66
import { locationIcon, personInCircleIcon as personInCircleIconSvg } from './icons'
77
import { FriendshipTriage } from './triage'
88

@@ -62,12 +62,8 @@ export function createHeaderSection (
6262
headerActions.className = 'social-pane__header-actions profile__actions profile__heading-actions'
6363

6464
if (headerControls.canEdit) {
65-
headerActions.appendChild(createEditProfileDetailsButton({
66-
dom,
67-
store: kb,
68-
subject,
69-
onSaved: renderHeader
70-
}))
65+
// Hidden for now because the social pane header edit control does not match the new design.
66+
// Revisit later if we decide to restore profile-link editing here.
7167
} else if (headerControls.viewerMode === 'authenticated' && headerControls.showAddFriendAction) {
7268
headerActions.classList.add('social-pane__header-actions--friend')
7369
const addToFriendsButton = createAddMeToYourFriendsButton(subject, context)

0 commit comments

Comments
 (0)