Merge pull request #2050 from iminoso/layout
Create all components for new repo page
This commit is contained in:
commit
74b6944b0d
8 changed files with 53 additions and 15 deletions
|
@ -1,9 +1,4 @@
|
|||
import * as React from "react";
|
||||
import * as angular from "angular";
|
||||
|
||||
import repoHeader from "./directives/components/component";
|
||||
|
||||
angular.module('quayPages').directive('repoHeader', function(reactDirective) {
|
||||
return reactDirective(repoHeader);
|
||||
});
|
||||
import {rpDirectives as repoPage} from "./directives/components/pages/repo-page/main";
|
||||
|
||||
// Init for each page
|
||||
repoPage();
|
||||
|
|
10
static/js/directives/components/pages/repo-page/body.tsx
Normal file
10
static/js/directives/components/pages/repo-page/body.tsx
Normal file
|
@ -0,0 +1,10 @@
|
|||
import * as React from "react";
|
||||
|
||||
class body extends React.Component<{}, {}> {
|
||||
render () {
|
||||
return <div> The component for the main content</div>;
|
||||
}
|
||||
}
|
||||
|
||||
export default body;
|
||||
|
|
@ -2,7 +2,7 @@ import * as React from "react";
|
|||
|
||||
class repoHeader extends React.Component<{}, {}> {
|
||||
render () {
|
||||
return <p> The component for the header</p>;
|
||||
return <div> The component for the header</div>;
|
||||
}
|
||||
}
|
||||
|
21
static/js/directives/components/pages/repo-page/main.tsx
Normal file
21
static/js/directives/components/pages/repo-page/main.tsx
Normal file
|
@ -0,0 +1,21 @@
|
|||
import * as angular from "angular";
|
||||
|
||||
import repoHeader from "./header";
|
||||
import repoSidebar from "./sidebar";
|
||||
import repoBody from "./body";
|
||||
|
||||
export function rpDirectives(){
|
||||
angular.module('quayPages').directive('rpHeader', function(reactDirective) {
|
||||
return reactDirective(repoHeader);
|
||||
});
|
||||
|
||||
angular.module('quayPages').directive('rpSidebar', function(reactDirective) {
|
||||
return reactDirective(repoSidebar);
|
||||
});
|
||||
|
||||
angular.module('quayPages').directive('rpBody', function(reactDirective) {
|
||||
return reactDirective(repoBody);
|
||||
});
|
||||
}
|
||||
|
||||
|
10
static/js/directives/components/pages/repo-page/sidebar.tsx
Normal file
10
static/js/directives/components/pages/repo-page/sidebar.tsx
Normal file
|
@ -0,0 +1,10 @@
|
|||
import * as React from "react";
|
||||
|
||||
class repoSidebar extends React.Component<{}, {}> {
|
||||
render () {
|
||||
return <div> The component for the sidebar</div>;
|
||||
}
|
||||
}
|
||||
|
||||
export default repoSidebar;
|
||||
|
|
@ -11,11 +11,6 @@
|
|||
}]);
|
||||
|
||||
function RepoViewCtrl($scope, $routeParams, $location, $timeout, ApiService, UserService, AngularPollChannel, ImageLoaderService, CookieService) {
|
||||
$scope.reactProps = {
|
||||
firstProp: 'Prop 1',
|
||||
secondProp: 'Prop 2'
|
||||
};
|
||||
|
||||
$scope.namespace = $routeParams.namespace;
|
||||
$scope.name = $routeParams.name;
|
||||
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
<!-- New Public Repo Page experiment -->
|
||||
<div ng-if="newRepoExperiment" class="main-panel">
|
||||
<!-- React Components -->
|
||||
<repo-header />
|
||||
<rp-header></rp-header>
|
||||
<rp-sidebar></rp-sidebar>
|
||||
<rp-body></rp-body>
|
||||
</div>
|
||||
<!-- Old Repo Page -->
|
||||
<div ng-if="!newRepoExperiment">
|
||||
|
|
5
tslint.json
Normal file
5
tslint.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rules": {
|
||||
"no-default-export": true
|
||||
}
|
||||
}
|
Reference in a new issue