Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console refresh #301

Merged
merged 13 commits into from
Jul 30, 2024
251 changes: 237 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/api/src/routers/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,12 @@ export function usersRouter(store: Store) {
);
return res;
}),

userForAddress: publicProcedure
.input(z.object({ address: z.string().trim().min(1) }))
.query(async ({ input }) => {
const res = await store.users.userForAddress(input.address);
return res;
}),
Comment on lines +21 to +26
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a new API, and you'll see the store support for it as well.

});
}
13 changes: 13 additions & 0 deletions packages/store/src/api/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,18 @@ export function initUsers(db: DrizzleD1Database<typeof schema>) {
.all();
return res;
},

userForAddress: async function (address: string) {
const res = await db
.select({
user: users,
team: teams,
})
.from(users)
.innerJoin(teams, eq(users.teamId, teams.id))
.where(eq(users.address, address))
.get();
return res;
},
};
}
2 changes: 1 addition & 1 deletion packages/web/app/[team]/(team)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default async function LayoutTeam({
}) {
return (
<div className="flex flex-1">
<div className="sticky top-[3.5rem] h-[calc(100vh-3.55rem)] w-52 flex-shrink-0 overflow-y-auto overflow-x-hidden bg-card">
<div className="sticky top-[3.507rem] h-[calc(100vh-3.507rem)] w-52 flex-shrink-0 overflow-y-auto overflow-x-hidden bg-card">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unreleated. Just finding the right magic number for our header height so things that sit below it are positioned properly.

<Sidebar />
</div>
<div className="mx-auto w-full min-w-0">{children}</div>
Expand Down
Loading
Loading