diff --git a/src/components/phoneComponents/MessageApp/ActionsHandlers/ActionHandlersTypeGuards.tsx b/src/components/phoneComponents/MessageApp/ActionsHandlers/ActionHandlersTypeGuards.tsx index 1d28f4a..5000fb3 100644 --- a/src/components/phoneComponents/MessageApp/ActionsHandlers/ActionHandlersTypeGuards.tsx +++ b/src/components/phoneComponents/MessageApp/ActionsHandlers/ActionHandlersTypeGuards.tsx @@ -4,6 +4,7 @@ import * as MessageAppInterfaces from "@/components/phoneComponents/MessageApp/M export const allowedChoiceActions = [ // Actions to be taken related to the page "goToPageIndex", + "goToExternalPageIndex", // Actions to be taken related to the messages "displayMessage", "replaceMessage", diff --git a/src/components/phoneComponents/MessageApp/BardDiscussion.tsx b/src/components/phoneComponents/MessageApp/BardDiscussion.tsx index 932b27c..9542ea4 100644 --- a/src/components/phoneComponents/MessageApp/BardDiscussion.tsx +++ b/src/components/phoneComponents/MessageApp/BardDiscussion.tsx @@ -181,7 +181,10 @@ export default function BardDiscussion(props: any){ return addMessageToHistory(message); } else if (action.type === "goToPageIndex") { nextRouter.push(action.target); - } else { + } else if (action.type === "goToExternalPageIndex"){ + nextRouter.push(action.target); + } + else { console.error(`The action "${action.type}" is not implemented!`); } } diff --git a/src/components/phoneComponents/MessageApp/MessageChoices.tsx b/src/components/phoneComponents/MessageApp/MessageChoices.tsx index 7cb3534..cff0e37 100644 --- a/src/components/phoneComponents/MessageApp/MessageChoices.tsx +++ b/src/components/phoneComponents/MessageApp/MessageChoices.tsx @@ -1,5 +1,5 @@ import { DiscussionChoicesInterface } from "./MessageAppInterfaces"; -import { authorPlayer, guestPlayer } from "./MessagePlayers"; +import { authorPlayer, bardPlayer, guestPlayer } from "./MessagePlayers"; export const messageChoices: DiscussionChoicesInterface[] = [ // The first choice and the default one @@ -102,8 +102,8 @@ export const messageChoices: DiscussionChoicesInterface[] = [ messagesToShow: [], actions: [ { - type: "goToPageIndex", - target: "/projects" + type: "goToExternalPageIndex", + target: "https://github.com/alexis-opolka/" } ] }, @@ -118,5 +118,17 @@ export const messageChoices: DiscussionChoicesInterface[] = [ ] } ] + }, + { + type: "choices", + startMessages: [ + { + "author": bardPlayer, + "content": "Hello, I'm testing a new way of calling pages.", + "type": "message" + } + ], + startActions: [], + options: [] } ] \ No newline at end of file