Implement preference controls on labelers
This commit is contained in:
@@ -12,22 +12,58 @@ export function useLabelBehaviorDescription(
|
||||
}
|
||||
if (labelValueDef.blurs === 'content') {
|
||||
if (pref === 'hide') {
|
||||
return _(msg`Hide content`)
|
||||
return _(msg`Hide`)
|
||||
}
|
||||
return _(msg`Warn content`)
|
||||
return _(msg`Warn`)
|
||||
} else if (labelValueDef.blurs === 'media') {
|
||||
if (pref === 'hide') {
|
||||
return _(msg`Hide images`)
|
||||
return _(msg`Hide`)
|
||||
}
|
||||
return _(msg`Warn images`)
|
||||
return _(msg`Blur images`)
|
||||
} else if (labelValueDef.severity === 'alert') {
|
||||
if (pref === 'hide') {
|
||||
return _(msg`Filter from feeds`)
|
||||
return _(msg`Hide`)
|
||||
}
|
||||
return _(msg`Show warning`)
|
||||
} else if (labelValueDef.severity === 'inform') {
|
||||
if (pref === 'hide') {
|
||||
return _(msg`Filter from feeds`)
|
||||
return _(msg`Hide`)
|
||||
}
|
||||
return _(msg`Show badge`)
|
||||
} else {
|
||||
if (pref === 'hide') {
|
||||
return _(msg`Hide`)
|
||||
}
|
||||
return _(msg`Disabled`)
|
||||
}
|
||||
}
|
||||
|
||||
export function useLabelLongBehaviorDescription(
|
||||
labelValueDef: InterprettedLabelValueDefinition,
|
||||
pref: LabelPreference,
|
||||
) {
|
||||
const {_} = useLingui()
|
||||
if (pref === 'ignore') {
|
||||
return _(msg`Disabled`)
|
||||
}
|
||||
if (labelValueDef.blurs === 'content') {
|
||||
if (pref === 'hide') {
|
||||
return _(msg`Warn content and filter from feeds`)
|
||||
}
|
||||
return _(msg`Warn content`)
|
||||
} else if (labelValueDef.blurs === 'media') {
|
||||
if (pref === 'hide') {
|
||||
return _(msg`Blur images and filter from feeds`)
|
||||
}
|
||||
return _(msg`Blur images`)
|
||||
} else if (labelValueDef.severity === 'alert') {
|
||||
if (pref === 'hide') {
|
||||
return _(msg`Show warning and filter from feeds`)
|
||||
}
|
||||
return _(msg`Show warning`)
|
||||
} else if (labelValueDef.severity === 'inform') {
|
||||
if (pref === 'hide') {
|
||||
return _(msg`Show badge and filter from feeds`)
|
||||
}
|
||||
return _(msg`Show badge`)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user