-
-
-
-
-
-
-
-
- Booking confirmed
-
-
-
- You are scheduled in with {props.user.name || props.user.username}.
-
-
-
-
{eventName}
-
-
- {props.eventType.length} minutes
-
- {location &&
-
- {location}
-
}
-
-
- {date.format((is24h ? 'H:mm' : 'h:mma') + ", dddd DD MMMM YYYY")}
-
-
-
-
-
-
Add to your calendar
-
-
-
+ const event = createEvent({
+ start: date
+ .utc()
+ .toArray()
+ .slice(0, 6)
+ .map((v, i) => (i === 1 ? v + 1 : v)),
+ startInputType: "utc",
+ title: eventName,
+ description: props.eventType.description,
+ duration: { minutes: props.eventType.length },
+ ...optional,
+ });
+
+ if (event.error) {
+ throw event.error;
+ }
+
+ return encodeURIComponent(event.value);
+ }
+
+ return (
+
+
+
Booking Confirmed | {eventName} | Calendso
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Booking confirmed
+
+
+
+ You are scheduled in with {props.user.name || props.user.username}.
+
+
+
{eventName}
+
+
+ {props.eventType.length} minutes
+
+ {location && (
+
+
+ {location}
+
+ )}
+
+
+ {date.format((is24h ? "H:mm" : "h:mma") + ", dddd DD MMMM YYYY")}
+
+
+
+
-
+ {!props.user.hideBranding && (
+
+ )}
+
+
+
- )
+
+
+ );
}
export async function getServerSideProps(context) {
- const user = await prisma.user.findFirst({
- where: {
- username: context.query.user,
- },
- select: {
- username: true,
- name: true,
- bio: true,
- avatar: true,
- eventTypes: true
- }
- });
+ const user = await prisma.user.findFirst({
+ where: {
+ username: context.query.user,
+ },
+ select: {
+ username: true,
+ name: true,
+ bio: true,
+ avatar: true,
+ eventTypes: true,
+ hideBranding: true,
+ },
+ });
- const eventType = await prisma.eventType.findUnique({
- where: {
- id: parseInt(context.query.type),
- },
- select: {
- id: true,
- title: true,
- description: true,
- length: true,
- eventName: true
- }
- });
+ const eventType = await prisma.eventType.findUnique({
+ where: {
+ id: parseInt(context.query.type),
+ },
+ select: {
+ id: true,
+ title: true,
+ description: true,
+ length: true,
+ eventName: true,
+ },
+ });
- return {
- props: {
- user,
- eventType
- },
- }
+ return {
+ props: {
+ user,
+ eventType,
+ },
+ };
}
diff --git a/prisma/migrations/20210629160507_hide_branding/migration.sql b/prisma/migrations/20210629160507_hide_branding/migration.sql
new file mode 100644
index 0000000000..0e6be4d5ec
--- /dev/null
+++ b/prisma/migrations/20210629160507_hide_branding/migration.sql
@@ -0,0 +1,2 @@
+-- AlterTable
+ALTER TABLE "users" ADD COLUMN "hideBranding" BOOLEAN NOT NULL DEFAULT false;
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 491fd909e7..8bddada9c1 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -47,6 +47,7 @@ model User {
startTime Int @default(0)
endTime Int @default(1440)
bufferTime Int @default(0)
+ hideBranding Boolean @default(false)
createdDate DateTime @default(now()) @map(name: "created")
eventTypes EventType[]
credentials Credential[]