aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.css
blob: 12fad732fecdf1a18af43d598ddd376c6f64f0bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@tailwind base;
@tailwind components;
@tailwind utilities;

@font-face {
	font-family: 'PublicSans';
	src: url('/fonts/Public_Sans/static/PublicSans-Regular.ttf') format('truetype');
}

html {
	font-family: PublicSans, sans-serif;
}

::selection {
	color: black;
	background: #eaf2ff;
}

:fullscreen {
	background-color: white;
}

input,
textarea {
	@apply block border rounded-2xl px-5 py-4 w-full;
}

button.primary {
	@apply rounded-full border py-2 font-bold my-4 flex px-4 bg-white mx-auto hover:opacity-80;
}

.select-styles {
	@apply border rounded-2xl py-4 px-5;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	background: transparent;
	background-image: url('/icons/down.svg');
	background-repeat: no-repeat;
	background-position-x: 95%;
	background-position-y: 1em;
}
10 11 12 13 14 15 16 17 18 19 20 21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
                                       
 
                                                              
                                               
                                 
                                   
 













                                                                                                
 
                     
                                                              
                             
                                                                                    
                 
 


                                              

         
                                                             
 
import { auth, get } from '$lib/utils';

export async function load({ cookies, params, parent, url }) {
	let { user, subject } = await parent();
	let { pubkey } = subject;
	let { since = 0 } = params;

	let messages, invoices, sent, received, notes;
	messages = invoices = sent = received = notes = [];

	if (pubkey) {
		if (user) {
			try {
				messages = await get(`/${user.pubkey}/${since}/messages`);
				messages = messages.sort((a, b) => b.created_at - a.created_at);
			} catch (e) {
				console.log(`failed to fetch nostr messages`, e);
			}

			({ invoices, sent, received } = await get('/requests', auth(cookies)));
		}

		try {
			notes = await get(`/${pubkey}/notes`);
		} catch (e) {
			console.log(`failed to fetch nostr notes for ${pubkey}`, e);
		}

		notes.map((e) => {
			e.seen = e.created_at;
		});
	}

	return { invoices, messages, notes, sent, received };
}