feat: stream list view and tasks (#279)
* first attempt at stream sidebar, tasks, and events * fix folder from root * cleanup folders and events, and condense changes * cleanup and add toggle for sidebar * cleanup * fix nits
This commit was merged in pull request #279.
This commit is contained in:
@@ -29,6 +29,8 @@ interface CreateParticleParams<T extends ParticleType = ParticleType> {
|
||||
type: T;
|
||||
properties: ParticlePropertiesMap[T];
|
||||
createdByHumanId: string;
|
||||
// Required for container types
|
||||
visibleTo?: string[];
|
||||
}
|
||||
|
||||
export function useCreateParticle() {
|
||||
@@ -59,6 +61,7 @@ export function useCreateParticle() {
|
||||
params.type,
|
||||
params.properties,
|
||||
params.createdByHumanId,
|
||||
params.visibleTo,
|
||||
);
|
||||
|
||||
if (!CONTAINER_TYPES.has(params.type)) {
|
||||
@@ -76,15 +79,17 @@ type CreateStreamParticleParams = {
|
||||
properties: ParticlePropertiesMap['stream'];
|
||||
createdByHumanId: string;
|
||||
visibleTo?: string[];
|
||||
// Container to create the stream in; defaults to the network root.
|
||||
parentPath?: ParticlePath;
|
||||
};
|
||||
|
||||
export function useCreateStreamParticle() {
|
||||
return useMutation({
|
||||
mutationFn: async (params: CreateStreamParticleParams) => {
|
||||
const path = particlePath(params.networkId, []);
|
||||
const networkCollectionPath = toFirestoreChildrenPath(path);
|
||||
const path = params.parentPath ?? particlePath(params.networkId, []);
|
||||
const collectionPath = toFirestoreChildrenPath(path);
|
||||
return await createStreamParticle(
|
||||
networkCollectionPath,
|
||||
collectionPath,
|
||||
params.properties,
|
||||
params.createdByHumanId,
|
||||
params.visibleTo,
|
||||
|
||||
Reference in New Issue
Block a user