mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-26 12:24:26 +03:00
avatars component updated
This commit is contained in:
parent
c364d6e901
commit
ea17f3ace4
@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import TimeAgo from '$lib/shared/TimeAgo.svelte';
|
||||
import { stringToColor } from '$lib/utils/stringToColor';
|
||||
import { tooltip } from '$lib/utils/tooltip';
|
||||
import { stringToColor } from '@gitbutler/ui/utils/stringToColor';
|
||||
import type { CombinedBranch } from '$lib/branches/types';
|
||||
import { goto } from '$app/navigation';
|
||||
import { page } from '$app/stores';
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
$effect(() => {
|
||||
selected = href ? $page.url.href.endsWith(href) : false;
|
||||
// console.log(branch.authors);
|
||||
});
|
||||
|
||||
function getBranchLink(b: CombinedBranch): string | undefined {
|
||||
|
@ -31,7 +31,7 @@
|
||||
});
|
||||
|
||||
function filterByText(branches: CombinedBranch[], searchText: string | undefined) {
|
||||
console.log('filterByText', branches, searchText);
|
||||
// console.log('filterByText', branches, searchText);
|
||||
if (searchText === undefined || searchText === '') return branches;
|
||||
|
||||
return branches.filter((b) => searchMatchesAnIdentifier(searchText, b.searchableIdentifiers));
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { stringToColor } from '$lib/utils/stringToColor';
|
||||
import { stringToColor } from '@gitbutler/ui/utils/stringToColor';
|
||||
export let name: string | undefined;
|
||||
|
||||
function getFirstLetter(name: string | undefined) {
|
||||
|
@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { stringToColor } from '$lib/utils/stringToColor';
|
||||
import { tooltip } from '$lib/utils/tooltip';
|
||||
|
||||
interface Props {
|
||||
@ -12,25 +13,14 @@
|
||||
const { srcUrl, tooltipText, altText }: Props = $props();
|
||||
</script>
|
||||
|
||||
<div class="image-wrapper">
|
||||
<!-- <img
|
||||
<div class="image-wrapper" style:background-color={stringToColor(altText)}>
|
||||
<img
|
||||
class="avatar"
|
||||
alt={altText}
|
||||
src={srcUrl}
|
||||
loading="lazy"
|
||||
onload={() => (isLoaded = true)}
|
||||
width="100"
|
||||
height="100"
|
||||
class:hidden={!isLoaded}
|
||||
use:tooltip={tooltipText}
|
||||
/> -->
|
||||
<img
|
||||
class="avatar"
|
||||
class:hidden={isLoaded}
|
||||
alt={altText}
|
||||
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAASCAYAAAA6yNxSAAAJcklEQVR4AQCBAH7/ANnXrf/Y163/19is/9XZq//R2an/zdqn/8jbpv/C26X/u9qk/7PYpP+r1aX/odGn/5fMqv+Nxq3/gr+x/3e3tf9srrn/YqW8/1idv/9QlsH/SpDB/0aMwf9FisD/R4q9/0qNuv9PkbX/VJaw/1mbq/9eoKb/YqWi/2Sonv9mqpz/AIEAfv8A2Neu/9jXrv/W2K3/1Nms/9Haqv/M2qj/x9um/8Lbpf+72qX/s9il/6vWpv+i0qj/mM2q/43Grv+Dv7L/eLe2/22vuf9ipr3/WZ6//1CXwf9KkcL/Ro3B/0aLwP9HjL3/S466/1CStv9Wl7H/W52s/2Cip/9kpqL/Z6mf/2irnP8AgQB+/wDV17D/1dew/9TYr//S2a7/z9qs/8vbqv/G26j/wdun/7rbpv+z2ab/q9en/6LTqf+Zzqz/j8iv/4TBs/95urb/brK6/2Oqvf9aosD/UZvC/0uVw/9HksL/R5DB/0qQvv9Ok7v/VJa3/1qbsv9goK3/ZaWo/2qppP9trKD/b66e/wCBAH7/ANHXtP/R2LT/0Niz/87Zsf/L2q//yNut/8Tcq//A3Kr/utyp/7Pbqf+s2Kn/pNWr/5vQrf+Ry7H/hsW0/3u9uP9wtrz/Za6//1unwf9SocP/TJzE/0mYxP9Jl8L/TZfA/1OZvf9ZnLj/YKG0/2elr/9tqqr/cq2m/3awov94sqD/AIEAfv8Ay9i4/8vYuP/K2bf/ydq1/8fbs//F3LH/wt2v/77drf+53az/s9ys/63arP+l167/nNOw/5POs/+IyLb/fsK6/3K7vf9ntM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xf9uycT/asbF/2XDx/9hwcr/XcDN/1u+0P9avdP/XL3V/2C81/9lvNf/bbvW/3W71P9+utH/h7nM/5C4xv+Yt8D/n7a5/6a1sv+rtaz/rrSn/7G0o/8BgQB+/wB+5uL/fuXh/37k4P994t3/fODa/3vd1v952dH/d9bN/3TSyv9xzsf/bcrF/2nHxf9lxMX/YMHH/12/yv9avs3/WLzQ/1m80/9bu9b/YLvX/2a61/9uutb/drnU/3+40f+IuMz/kLfG/5i1v/+ftLj/pbOx/6qyq/+usqb/sLGi/+et3p4B1/E6AAAAAElFTkSuQmCC"
|
||||
width="100"
|
||||
height="100"
|
||||
class:show={isLoaded}
|
||||
use:tooltip={tooltipText}
|
||||
/>
|
||||
</div>
|
||||
@ -40,20 +30,24 @@
|
||||
display: grid;
|
||||
place-content: center;
|
||||
overflow: hidden;
|
||||
border-radius: 6px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.image-wrapper > * {
|
||||
grid-area: 1 / 1;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
.avatar {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
position: relative;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 6px;
|
||||
.show {
|
||||
opacity: 1;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user