1.3.15 • Published 12 months ago

pageblox-react v1.3.15

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

Pageblox

Pageblox is an open-source React tool that generates preview links with a real-time, collaboration review interface. It replaces the back-and-forth screen recordings and conversations that usually occur when giving feedback on UX/UI changes.

Contributions are welcome! You can try out the alpha today.

Installation

React Library

You'll first need to obtain a project key, which can be obtained by signing up here.

Run the following command in the root of your React application using your terminal:

npm install pageblox-react

Github Actions

To create preview links, a Github Actions workflow is required. This will build the React project on every push to a branch and deploy it using Github Pages. The URL will be in the form of https://<USERNAME>.github.io/<REPO>/.

Creating the workflow file

Start by creating a .github/workflows folder, and add a deploy.yml file. Depending on the React library used, the build folder path will change. The following example is for a Vite project, so the folder path is dist.

To toggle Pageblox, you want to create an environment variable in your repo, and set it equal to true upon build.

Lastly, ensure that your repository is configured to have its GitHub Pages site deployed from a branch, by setting the source for the deployment under Settings > Pages of your repository to Deploy from branch. Best practice is to name this branchgh-pages. You can learn more about deploying from a branch here.

name: Build and Deploy
on: [push]
permissions:
  contents: write
jobs:
  build-and-deploy:
    concurrency: ci-${{ github.ref }}
    runs-on: ubuntu-latest
    env:
      VITE_DISPLAY_PREVIEW: "true"
    steps:
      - name: Checkout 🛎️
        uses: actions/checkout@v3
      - name: Install and Build 🔧 
        run: |
          npm ci
          npm run build

      - name: Deploy 🚀
        uses: JamesIves/github-pages-deploy-action@v4
        with:
          folder: dist # The folder the action should deploy. Adjust this value based on your react library.

Usage

After installation, you need to wrap your application with PagebloxProvider and import the pageblox.css file.

Finally, create an environment variable named DISPLAY_PAGEBLOX with the appropriate prefix depending on your platform, and initialize it to false.

Using NextJS

Use _app.js to utilize the pageblox wrapper. You can find more info here.

import { PagebloxProvider } from 'pageblox-react'
import 'pageblox-react/dist/pageblox.css'

export default function App({ Component, pageProps }) {
  return (
    <PagebloxProvider projectId="playgroundKey"
    enabled={import.meta.env.NEXT_PUBLIC_DISPLAY_PAGEBLOX === 'true'}>
      <Component {...pageProps} />
    </PagebloxProvider>
  )
}

Using Create React App / Vite Example

import React from 'react'
import ReactDOM from 'react-dom/client'
import { BrowserRouter } from 'react-router-dom'
import { PagebloxProvider } from 'pageblox-react'
import App from './App.jsx'
import './index.css'
import "pageblox-react/dist/pageblox.css"

ReactDOM.createRoot(document.getElementById('root')).render(
  <React.StrictMode>
    <PagebloxProvider projectKey="sample-key"
    enabled={import.meta.env.VITE_DISPLAY_PAGEBLOX === 'true'}>
      <BrowserRouter>
        <App />
      </BrowserRouter>
    </PagebloxProvider>
  </React.StrictMode>,
)

Generating a preview link

Once you've imported the PagebloxProvider & CSS file, as well as created an appropriate environment variable used in the actions workflow, go ahead and push changes to a remote branch.

You can view the progress of this workflow under the Actions tab in your repository.

Once it's completed, visit https://<USERNAME>.github.io/<REPO>/ and you'll see the Pageblox widget on the bottom right of your app. Click on it to start commenting!

Where to get help

You can raise issues in this repo, or feel free to e-mail at bhavan@pageblox.io with any questions.

Important Links

  • Signup here to get your project key
  • E-mail bhavan@pageblox.io to get the latest updates & support.
1.3.14

12 months ago

1.3.15

12 months ago

1.2.0

1 year ago

1.3.13

1 year ago

1.3.11

1 year ago

1.3.12

1 year ago

1.3.9

1 year ago

1.3.8

1 year ago

1.3.7

1 year ago

1.3.6

1 year ago

1.3.5

1 year ago

1.3.3

1 year ago

1.1.5

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.1002

1 year ago

1.0.1001

1 year ago

1.0.1000

1 year ago

1.0.999

1 year ago

1.0.998

1 year ago

1.0.997

1 year ago

1.0.996

1 year ago

1.0.995

1 year ago

1.0.994

1 year ago

1.0.993

1 year ago

1.0.992

1 year ago

1.0.991

1 year ago

1.0.99

1 year ago

1.0.98

1 year ago

1.0.97

1 year ago

1.0.96

1 year ago

1.0.95

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago