How to use the react-static.withRouter function in react-static

To help you get started, we’ve selected a few react-static examples, based on popular ways it is used in public projects.

github iotaledger / documentation-platform / src / components / Dropdown.js View on Github external
return (
      <DropdownWrapper>
        <Dropdownlist value={selected} onChange={this.selectItem}>
          {items.map(item => (
            <DropdownItem key={item} value={item}>
              {item}
            </DropdownItem>
          ))}
        </Dropdownlist>
      </DropdownWrapper>
    );
  }
}

export default withRouter(Dropdown);

const DropdownWrapper = styled.div`
  width: 100px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
`;

const Dropdownlist = styled.select`
  position: absolute;
  background-color: #f0f6f8;
  padding: 5px 11px;
  z-index: 10;
  border: solid 1px #d8d8d8;
  border-top: none;
github FormidableLabs / victory-docs / src / containers / doc.js View on Github external
</ContentWithSidebarController>
    );
  }
}

DocsTemplate.propTypes = {
  children: PropTypes.array,
  doc: PropTypes.shape({
    data: PropTypes.object,
    content: PropTypes.string
  }),
  location: PropTypes.object,
  sidebarContent: PropTypes.array
};

export default withRouter(
  withRouteData(({ doc, sidebarContent, ...rest }) => (
    <DocsTemplate doc={doc} sidebarContent={sidebarContent} {...rest} />
  ))
);
github FormidableLabs / victory-docs / src / partials / sidebar / index.js View on Github external
]}
              />
            </React.Fragment>
          )}
        </div>
      </nav>
    );
  }
}

Sidebar.propTypes = {
  content: PropTypes.array,
  location: PropTypes.object
};

export default withRouter(Sidebar);
github iotaledger / documentation-platform / src / components / Sidebar.js View on Github external
<Dropdown version={version} items={Object.keys(menu[project].versions)}/>
                </div>
                <div className="scroll">
                  <Menu items={menu[project].versions[version]} />
                </div>
              </div>
            </ClickOutside>
            <div className="content">{children}</div>
          </SidebarStyles>
        )}
      />
    )
  }
}

export default withRouter(Sidebar);

const breakpoint = 800
const sidebarBackground = '#f7f7f7'

const SidebarStyles = styled.div`
  position: relative;
  width: 100%;
  max-width: 100%;
  padding-left: 300px;
  margin: 0 auto;
  transition: all 0.2s ease-out;

  @media screen and (max-width: ${breakpoint}px) {
    padding-left: 0px;
  }
github FormidableLabs / victory-docs / src / containers / themes.js View on Github external
</div>
      </ContentWithSidebarController>
    );
  }
}

DocsTemplate.propTypes = {
  children: PropTypes.array,
  doc: PropTypes.shape({
    data: PropTypes.object
  }),
  location: PropTypes.object,
  sidebarContent: PropTypes.array
};

export default withRouter(
  withRouteData(({ doc, sidebarContent, sidebarNestedList, ...rest }) => (
    <DocsTemplate
      doc={doc}
      sidebarContent={sidebarContent}
      sidebarNestedList={sidebarNestedList}
      {...rest}
    />
  ))
);
github iotaledger / documentation-platform / src / components / organisms / StickyHeader / index.js View on Github external
className="sticky-header__icon-close"
                                onClick={this.handleCloseClick}
                            />
                        </div>
                    )}
                    <button
                        className="sticky-header__icon-burger"
                        onClick={this.handleBurgerClick}
                    />
                </div>
            </header>
        );
    }
}

export default withRouter(StickyHeader);
github FormidableLabs / victory-docs / src / containers / content-with-sidebar-controller.js View on Github external
<Footer />
            </div>
          </ArticleWrapper>
        </ContentWithSidebarPage>
      </React.Fragment>
    );
  }
}

ContentWithSidebar.propTypes = {
  children: PropTypes.array,
  content: PropTypes.array,
  sidebarContent: PropTypes.array
};

export default withRouter(ContentWithSidebar);
github react-static / react-static / archives / old-examples / firebase-auth / src / components / SignInForm.js View on Github external
onChange={event =>
            this.setState(updateByPropertyName('password', event.target.value))
          }
          type="password"
          placeholder="password"
        />
        <button disabled={isInvalid} type="submit">
          Sign In
        </button>
        {error && <p>{error.message}</p>}
      </form>
    )
  }
}

export default withRouter(SignInForm)