Merge branch 'feat/ui-1.0.2' of git.backyard.segmentfault.com:opensource/answer into feat/ui-1.0.2

This commit is contained in:
haitao(lj) 2022-12-27 11:36:32 +08:00
commit 2b65141625
3 changed files with 30 additions and 1121 deletions

File diff suppressed because it is too large Load Diff

View File

@ -26,6 +26,7 @@ const Index: FC<Props> = ({ data }) => {
answerId: data.object.id,
});
}
return (
<ListGroupItem className="py-3 px-0 border-start-0 border-end-0 bg-transparent">
<div className="mb-2 clearfix">

View File

@ -81,20 +81,13 @@ function formatUptime(value) {
return `< 1 ${t('dates.hour')}`;
}
function escapeRemove(str) {
function escapeRemove(str: string) {
if (!str || typeof str !== 'string') return str;
const arrEntities = {
lt: '<',
gt: '>',
nbsp: ' ',
amp: '&',
quot: '"',
'#39': "'",
};
return str.replace(/&(lt|gt|nbsp|amp|quot|#39);/gi, function (all, t) {
return arrEntities[t];
});
let temp: HTMLDivElement | null = document.createElement('div');
temp.innerHTML = str;
const output = temp?.innerText || temp.textContent;
temp = null;
return output;
}
function mixColor(color_1, color_2, weight) {
function d2h(d) {