Allow theming of Confirmation page / Message

Created on 22 June 2023, over 1 year ago
Updated 30 June 2023, over 1 year ago

Hi, I am trying to theme the confirmation message but I cannot find how to decorate the message component. I've looked to the examples and decorate some field elements using the "withCustomStyles" example (https://github.com/lauriii/next-acms-webform/blob/theming-example/pages/...) but I cannot theme the message.
Even if I wanted to use the markup provided from the webform configuration the markup gets rendered as string including HTML tags.

Am I missing something or this is not possible at the moment?

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Fixed

Component

Code

Created by

🇬🇧United Kingdom matteo.borgognoni

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @matteo.borgognoni
  • First commit to issue fork.
  • @hooroomoo opened merge request.
  • 🇺🇸United States hooroomoo

    Thanks for filing this issue, I created an MR that should allow this now. If you are using the 'withCustomStyles' example, add a 'messageProps' property to pass into the . Here is an example

    const messageProps = {
      className: classNames(['text-red-700', 'text-sm', 'font-bold'])
     }
    
    <Webform id={id} data={webform} customComponents={{
              message: withCustomStyles(components.message, {}, {}, {}, {}, {}, {}, messageProps),
              confirmation_page: withCustomStyles(components.confirmation_page, {}, {}, {}, {}, {}, {}, messageProps),
        }}/>
    

    You could also do something like this where you pass in a variable with a custom message and theme.

    export const Message1 = () => {
      return <div {...messageProps}>Hello I am a confirmation message</div>;
    }
    
    <Webform id={id} data={webform} customComponents={{
              message: Message1,
        }}/>
    
  • Status changed to Needs review over 1 year ago
  • 🇺🇸United States hooroomoo

    Thanks for filing this issue, I created an MR that should allow this now. If you are using the 'withCustomStyles' example, pass your styling to the the wrapperProps argument of the EnhancedComponent.

    const messageProps = {
      className: classNames(['text-red-700', 'text-sm', 'font-bold'])
     }
    
    <Webform id={id} data={webform} customComponents={{
              message: withCustomStyles(components.message, {}, {}, messageProps),
              confirmation_page: withCustomStyles(components.confirmation_page, {}, {}, messageProps),
        }}/>
    

    You could also do something like this where you pass in a variable with a custom message and theme.

    export const Message1 = () => {
      return <div {...messageProps}>Hello I am a confirmation message</div>;
    }
    
    <Webform id={id} data={webform} customComponents={{
              message: Message1,
        }}/>
    
  • First commit to issue fork.
  • Status changed to Fixed over 1 year ago
  • 🇫🇮Finland lauriii Finland

    Thanks! Merged!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024